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

Creating an populating a .txt file with a recordset

Status
Not open for further replies.

herci

Programmer
Nov 8, 2002
23
0
0
PA
Hi I´am kind of new using VB6

How can I create and populate a .txt file using a recordset with an ADODB?


I will apreciate any kind of help..
thank
 
Try persiting to XML... which can easily be changed to any text format file:

Dim objCon As ADODB.Connection
Dim objRec As ADODB.Recordset

Set objCon = New ADODB.Connection
Set objRec = New ADODB.Recordset

objCon.Open YOURCONNECTIONSTRING

objRec.Open "SELECT * FROM yourtable", objCon

objRec.Save "c:\yourxml.xml", adPersistXML

objRec.Close
Set objRec = Nothing
objCon.Close
Set objCon = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top