Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What do you mean calling OPEN is Invalid if it is CLOSED
Message
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00405178
Message ID:
00405310
Views:
18
>I am getting the following error when I try to open an ADO Recordset
>
>Run-Time error 3709.
>Operation is not allowed on an object referencing a closed or invalid connection.
>
>This doesn't happen every time either. But when I check rsMine.State it is 0 (closed) and it is a valid recordset because it works the first time and it is a read only recordset so I can't change it.
>
>Here is the function that screws up.
>
>Public Function LoadComboBox(rsMine As ADODB.Recordset, cboBox As ComboBox)
>   With cboBox
>      .Clear
>      If rsMine.State = 0 Then rsMine.Open
>      While Not rsMine.EOF
>         If Not IsNull(rsMine!Name) Then
>            .AddItem rsMine!Name
>            .ItemData(.NewIndex) = rsMine!ID
>         End If
>         rsMine.MoveNext
>      Wend
>   End With
>   Set rsMine = Nothing
>End Function
>
Can you build a simple example that replicate your problem (using NWind or Biblio MDB) so that I can trace it?
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform