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

problem with fso

Status
Not open for further replies.

parames

MIS
Jun 26, 2000
71
MY
hi list..

i want to transfer data from my database to text file..part of my code looks
like this..

set fstemp = server.CreateObject("Scripting.FileSystemObject")
Set filetemp = fstemp.CreateTextFile(whichFN, true)
' true = file can be over-written if it exists
' false = file CANNOT be over-written if it exists

1 Set Conn = Server.CreateObject("ADODB.Connection")
2 Conn.Open "DSN=project;UID=root;pwd="
3
4 sql="SELECT * from sales"
5 Set RS = Conn.Execute (sql)
6
7 While not RS.EOF
8 filetemp.WriteLine RS("internal_sonum"),RS("external_sonum")
9 RS.movenext
10 wend
11 RS.close

the problem now is at line 8, i want to print one line with more than one
column from database..
and i get this error..
"Microsoft VBScript runtime error '800a01c2'

Wrong number of arguments or invalid property assignment: 'WriteLine' "

can anybody please help me.. very urgent..

thanks alot..
rgds,
parames.s


 
Hello!
Try to change line 8 so it'll look like that:
filetemp.WriteLine ( RS("internal_sonum") & RS("external_sonum") )
I hope that will help.
 
If you want commas inbetween the fields use this:

filetemp.WriteLine RS("internal_sonum") & "," & RS("external_sonum")
Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top