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

DoCmd.TransferText acExportFixed help

Status
Not open for further replies.

axism

MIS
May 17, 2005
58
Hi, I created a view name queryExtractData in sql server 2000, which returns a few columns in tables and I am trying to export the result of the returned columns to a text file using DoCmd.TransferText. I have a button and the code following was what i typed in the on click event for button.
Code:
Private Sub cmdExtract_Click()
DoCmd.TransferText acExportFixed, , "queryExtractData", "c:\mytest\test.txt"
End Sub

And it's saying queryExtractData is not define when i click on button.  Please help!
 
When transfering a Fixed Width style you have to supply a SpecificationName. If you don't necessarily need it to be fixed width try using acExportDelim to export it to a delimited file. Then you don't need the Specification File.

Hope this helps.

OnTheFly
 
Thanks for replying Onthefly, I am not exactly sure what is a specification file. but when i try extracting a table with fixed length. It came out fine. I used the exact syntax, just replaced, queryextractdata with name of table instead. It was able to pick up table name while it doesn't not recognize the name of my query. acExportDelim doesn't work for me either. Tried that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top