Results 1 to 5 of 5

Thread: Simple Recordset Q

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    57

    Red face

    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??

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    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
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    Code:
    While Not (rs.EOF)
      vTemp = rs.Fields("field")
      '... do some actions
      rs.MoveNext
    Wend

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Make sure you do an rs.MoveFirst before going into the loop.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width