|
-
Jan 6th, 2003, 02:11 AM
#1
Thread Starter
Member
Export records to text file through SQL query
Hi,
Does anyone know how to export a table to a text file through a SQL query?
-
Jan 6th, 2003, 03:29 AM
#2
Frenzied Member
What database are you using?
-
Jan 6th, 2003, 03:31 AM
#3
Thread Starter
Member
Microsoft Access 2000 with ADO 2.6 through VB 6.0
-
Jan 6th, 2003, 03:37 AM
#4
Frenzied Member
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 04:41 AM.
-
Jan 6th, 2003, 04:13 AM
#5
Thread Starter
Member
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|