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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass-Through Query to a tab-delimited text file

Status
Not open for further replies.

trpnbillie

Programmer
Oct 8, 2002
28
US
Does anyone know if it's possible to export data into a tab delimited file from a PASS-THROUGH query?

I am able to use the following, but not with the results i want:

1) DoCmd.TransferText - I can only use with a table or regular select query. If I try my PASS-THROUGH query, it fails.

2) DoCmd.OutputTo - exports the data from my PASS-THROUGH query but in a pipe delimited format (i cannot get it to be tab-delimited, no text qualifying text file)

My code =
--------
Private Sub Command33_Click()
Dim strSQLForSP As String
Dim ID1 As String
Dim ID2 As String


ID1 = Form_Form1.cbox_iID1
ID2 = Form_Form1.cbox_iID2


strSQLForSP = "mySQLSproc " & ID1 & " , " & ID2
CreatePassThroughQuery strSQLForSP, "ReportQuery", False, True
DoCmd.TransferText acExportDelim, MySpec, "ReportQuery", "C:\Test.txt"

End Sub
--------------


Is it not possible to do this or is there another way? Essentially, I want the results from my pass-through query into an external text file.

Notes - my PASS-THROUGH query executes a SQL stored procedure. If i could create a select query AFTER my pass-through query is executed, I would, but I don't know how since it is created dynamically....

Thanks for any help!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top