-
I'm using an ftp class that gets a directory list
into a disconnected recordset
but when i have the recordset I can't get a string out of it to put into a variable.
dim rs as recordset
rs = oFTP.getdirectorylist
rs.open
rs.movefirst
dim vTemp as string
while not rs.eof
'vTemp = rs' -->no good
vTemp = Cstr(rs)' -->no good
any ideas??
-
<?>
dim rs as recordset
rs = oFTP.getdirectorylist
rs.open
rs.movefirst
dim vTemp as string
while not rs.eof
'vTemp = rs' -->no good
vTemp = Cstr(rs)' -->no good
vTemp = rs!yourfieldname
-
Code:
While Not (rs.EOF)
vTemp = rs.Fields("field")
'... do some actions
rs.MoveNext
Wend
-
Make sure you do an rs.MoveFirst before going into the loop.
-
Yes off coarse.
Code:
If (rs.RecordCount > 0) then
'Test the RecordCount property, otherwise, zero-length tables will give an error!
rs.MoveLast
rs.MoveFirst
'The table has been refreshed...
While Not (rs.EOF)
vTemp = rs.Fields("field")
'... do some actions
rs.MoveNext
Wend
End if
rs.Close 'Always close the RecordSet!