Results 1 to 3 of 3

Thread: determine recordset closed?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    how does one determine if a recordset is opened or closed?
    i tried
    Code:
    if rs.open then
       msgbox "Record is open
    else
       msgbox "Record is closed"
    end if
    it didn't work, and i didn't expect it to work
    but i thought i would give it a shot before posting a message on it
    thanks



  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    Talking nevermind

    just answered my own question
    if anyone wants to knw how

    you check for if RS.State = adStateOpen


  3. #3
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621
    Here is another way Kovan

    Code:
    'Good for closing recordset's, connection, workspaces
        If Not rs Is Nothing Then
            rs.Close
            Set rs = Nothing
        End If
    
    'Something similar to yours.
    
        If Not rs Is Nothing Then
             msgbox = "Recordset is open"
        else
             msgbox ="Recordset is closed"
        End If
    I had some problems that if the recordset was closed the adStateOpen returned an error. Not sure if it was my programming though.
    Gary Lowe
    VB6 (Enterprise) SP5
    ADO 2.6
    SQL Server 7 SP3

    OK I know my spelling and grammer is crap so don't quote me on it!

    To err is human to take the P! is only natural !!

    Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip


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