export access table to txt file 
Author Message
 export access table to txt file

Hi their. Im trying to export a database table to a text file so far i've
not found much useful stuff with regards to the export method. Basicly im
trying to do something like this

  databasename.tablename.export ("c:\temp.txt")

Any help of this would be much appriciated.

Thanks in advance

oh ya, im using vb5 on access database



Fri, 29 Jul 2005 02:50:11 GMT  
 export access table to txt file
No problem!!

Open the database with a standard ADO connection and then add:

Dim cmd as object
Set CMD = CreateObject("ADODB.Command")
cmd.activeConnection = cn  '-- the connection object
cmd.commandType =  1  'which is the same thing as adcmdtext
cmd.CommandText = "SELECT * Into [text;hdr=yes;database=C:\][nameoffile.txt]
From [tablename]"
cmd.Execute

hth


Quote:
> Hi their. Im trying to export a database table to a text file so far i've
> not found much useful stuff with regards to the export method. Basicly im
> trying to do something like this

>   databasename.tablename.export ("c:\temp.txt")

> Any help of this would be much appriciated.

> Thanks in advance

> oh ya, im using vb5 on access database



Fri, 29 Jul 2005 11:17:17 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Export Pocket Access table to TXT file?

2. Exporting a table as a txt file Help!

3. export data from local txt file to .mdb file on server

4. Export a table from access as dbase 5 file

5. Export an Access Table to Excel File Format

6. Export an Access table to a text (fixed width) file

7. export data from an Access table to a text file via vbScript

8. How to export an Access table to a binary file in Visual Basic

9. Export Access Table to Delimited Text File

10. Access 97: Export a pass-through query as txt

11. Exporting access table to foxpro table

12. Export to TXT or CSV from Access - then Import

 

 
Powered by phpBB® Forum Software