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

Write recordset to file

Status
Not open for further replies.

MDA

Technical User
Jan 16, 2001
243
US
Hi all,

Could someone help me with an example of writing a recordset to a text file. I would like to use ADO that will connect to SQL Server. I have about 10 columns of data and have to make sure there are no quotation marks.

I actually need the file in CSV format if any hints on that as well. Any examples or ideas are greatly appreciated.

Many thanks in advance..

Best regards,

Mike
 
ADODB versions higher than 2.6 provide a method called Sve for the ADODB.Recordsets, it can save your Recordset in XML format.

Hope this helps, s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
Check out the FileSytemObject's TextStream. Very easy to use! you'll final output code will be based on a recordset something like


With TStream


.Write RSt(0) & "," & rst(1) & "," & Rst(2)...and so on for each column of data

rst.movenext ....for each row


end with
 
sorry, bad typing. the method name is Save.

To read the files created with save you use the classic Open method. s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top