Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

e-mail a query on paradox 7.0 1

Status
Not open for further replies.

ittechco

Technical User
Mar 15, 2002
1
US
I am trying to send an e-mail of a query done under paradox 7.0, the query appears and I ccan export it to exel, but can not make a file in word for windows, or ascii in dos, to be able to paste it into the mail software, outlook express. if I send it as an attachment the receiver has to have paradox, and they dont.
 
This scirpt performs a query on a table. The data in the Answer table is exported to a text ASCII file and then send out via e-mail.
You need to change the query table name and fields and e-mail receipent's web address.

Var
Q Query
lError Logical
m MAIL
sMsgRecip String
sMsgSubj String
sMsgText String
sAttach String
endVar

sMsgRecip = "NameHere@address.com"
sMsgSubj = "Your data"
sMsgText = "Here is the info you have requested."
sAttach = "C:\\data.txt"

Q=Query
mytable.DB | myfield |
| Check |
EndQuery
If Not Q.ExecuteQBE() Then
MsgStop("Error","Cannot get data.")
ErrorShow()
Return
EndIf

If IsEmpty(":pRIV:Answer.db") Then
MsgStop("Status","No data is found.")
Return
EndIf

lError = False
Try
ExportASCIIVar(":pRIV:Answer.db",sAttach)
OnFail
lError = True
EndTry

If lError Then
MsgStop("Error","Cannot export data.")
Return
EndIf

m.logonDlg()
m.addAddress(sMsgRecip)
m.setSubject(sMsgSubj)
m.setMessage(sMsgText)
m.addAttachment(sAttach)
m.send() ; Send the message
m.logoff()

MsgInfo("Status","Data has been sent to "+sMsgRecip)

 
I'm not sure I understand correctly, but if I'm right all you need to do is change the extension on the query to that of a text file (i.e. myquery.qbe would be changed to myquery.txt). They are only text files and can be looked at by notepad.



Mac
:)
 
Ittechco,

While you can email the results of a query to someone, it doesn't actually do what you're looking for. As JoeNg points out, you'll need to save the results of a query to a file suitable for emailing.

Typically, this is done by either exporting query answers to a text file, as JoeNg demonstrated, or by printing a report to a text file or Abode PDF file.

If you're using Paradox 8 or later, you can print reports to text files (or even HTML). If you have Adobe Distiller (or Exchange), you can print a report to a PDF and then email that. An example of printing a Paradox report to a PDF file can be found at
Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top