Hi,
Does anyone know how to export a table to a text file through a SQL query?
Hi,
Does anyone know how to export a table to a text file through a SQL query?
ganraj.
Microsoft Access 2000 with ADO 2.6 through VB 6.0
ganraj.
You could use Access' built-in Export functionality - you'll need to add an Access object to your code and use Automation.
Or if XML is acceptable, you could look at the Save method of the recordset:
VB Code:
rst.Save "c:\myfile.xml", adPersistXML
Or, finally, you'll have to code it, looping through the recordset and writing to the file. This will be the most hard work, but will also give you greatest control...
Last edited by PilgrimPete; Jan 6th, 2003 at 03:41 AM.
I am looking for a query something like this to run in ADO:
db.Execute "SELECT * INTO [Text;database=c:\testdata]. HEADER0.txt from mytable"
The above query runs in DAO but not is ADO.
Any Help?
ganraj.