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

how to write record_set to a file

Status
Not open for further replies.

y3by

Programmer
Jan 15, 2002
92
PT
hi ppl
i need to write a record ser to a file.
i'll explain better,

i need to simulate what i do using DTS in sqlserv to a fixed filed text file.
when i use sqlserv export the file as this look

A B C D E
500 1 15 002 10-02-2002
501 3 20 002 10-02-2002
505 45 1 999 31-05-2002

in vb i execute my query

"set rs = cmd.execute"

and then i open the file for output

"open c:\xpto.txt for output"

can i do something like this :

" while not rs.eof
line= rs() 'in where i want to pass the line of the rs
print #1,line"

thanks for your help in advanced
 
I would do it pretty much that way except for the following.
1) I would write a type statement that matches the recordset I wanted to post.
2) I would use update the type statement in the recordset loop.
3) I would use a put statement to write to the file.
Good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top