Hi everybody, I'm doing a simple form with a 3-table DB in access, . I'm trying to connect but I'm gettin this message: "the connection cannot be used to perform this operation. It's either closed or invalid in this context". this is the code I have
Private Sub lst_sport_DblClick(Cancel As Integer)
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
'Use the ADO connection that Access uses
Set cn = New ADODB.Connection
'Create an instance of the ADO Recordset class, and
'set its properties
Set rs = New ADODB.Recordset
Set .ActiveConnection = cn
.Source = "SELECT * from sports"
.LockType = adLockOptimistic
.CursorType = adOpenKeyset
Can u please tell me what am I doing wrong???
THanks in advanced