Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IS rset opened???? (6.0)

    I have this conn to open a rset, is possibkle to verify, before to close rset if it is opened...
    similar:

    rset is open then
    close
    elsle...

    rst.Close
    rst.Open FOGLIO, cnn, adOpenKeyset, adLockOptimistic, adCmdTableDirect

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: IS rset opened???? (6.0)

    <code>If CBool(rst.State and adStateOpen) Then rst.Close</code>
    should do it.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IS rset opened???? (6.0)

    ... HUMMMMM.........
    Nice code...
    about tath???:

    If rst.State = 1 Then
    rst.Close
    End If

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: IS rset opened???? (6.0)

    If your recordset is synchronous, then that will work because it is only open or closed. The version I posted will work whether it is synchronous or asynchronous.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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