Paul Burrows
asked on
What is syntax to export a txt file from Access 2007 database
I wish to export a text file to disk from the results of a query
I am using the syntax:
DoCmd.TransferText acExportFixed, "Export-600-01 C Type", , "R:\Despatch\PBLink\600-01 C Type.TXT", False
This message appears:
Run-time error '2495':
The action or method requires a Table Name argument.
Where have I gone wrong? Is there a better way?
I am using the syntax:
DoCmd.TransferText acExportFixed, "Export-600-01 C Type", , "R:\Despatch\PBLink\600-01
This message appears:
Run-time error '2495':
The action or method requires a Table Name argument.
Where have I gone wrong? Is there a better way?
Try this:
DoCmd.TransferText acExportDelim, "Standard Output", _
"External Report", "R:\Despatch\PBLink\600-01 -C-Type.TX T"
DoCmd.TransferText acExportDelim, "Standard Output", _
"External Report", "R:\Despatch\PBLink\600-01
ASKER
mx: I am not sure whether I should be using the DoCmd.outputto command
raju1: I definitely want file to be fixed length - not delimited
raju1: I definitely want file to be fixed length - not delimited
ASKER
mx: What could "YourTableNameHere" be?
Well ... in your post:
DoCmd.TransferText acExportFixed, "Export-600-01 C Type", , "R:\Despatch\PBLink\600-01 C Type.TXT",
the table or query name goes between the two commas ^^^
mx
DoCmd.TransferText acExportFixed, "Export-600-01 C Type", , "R:\Despatch\PBLink\600-01
the table or query name goes between the two commas ^^^
mx
ASKER
As soon as I change line to read:
DoCmd.TransferText acExportFixed, "Export-600-01 C Type", "600-01 C Type", "R:\Despatch\PBLink\600-01 C Type.TXT"
The following message appears:
Run-time error '3625':
The text file specification 'Export-600-01 C Type' does not exist. You
cannot import, export, or link using the specification.
This is the name used in the wizard - see screenshot
DoCmd.TransferText acExportFixed, "Export-600-01 C Type", "600-01 C Type", "R:\Despatch\PBLink\600-01
The following message appears:
Run-time error '3625':
The text file specification 'Export-600-01 C Type' does not exist. You
cannot import, export, or link using the specification.
This is the name used in the wizard - see screenshot
ASKER
Won't upload screen .... I don't know whats wrong now .... I just loaded explorer 8 so probably the latest security 'fix' from microsoft which stops everything working
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Run-time error '2511':
The action or method requires a Specification Name argument.
The action or method requires a Specification Name argument.
ASKER
DoCmd.TransferText acExportFixed, "600-01 C Type Export Specification", "600-01 C Type", "R:\Despatch\PBLink\600-01 C Type.TXT"
Thanks
Thanks
"Grade: A - "DoCmd.TransferText acExportFixed, "600-01 C Type Export Specification", "600-01 C Type", "R:\Despatch\PBLink\600-01 C Type.TXT"
Thanks "
Always a pleasure Zarbs ...
mx
Thanks "
Always a pleasure Zarbs ...
mx
ASKER
mx
I'm always pleased you are about to prod me in the right direction.
I can go off happily to play squash without worrying about it
Cheers
I'm always pleased you are about to prod me in the right direction.
I can go off happily to play squash without worrying about it
Cheers
DoCmd.TransferText acExportFixed, "Export-600-01 C Type", "YourTableNameHere" , "R:\Despatch\PBLink\600-01
mx