a problem trying to open a recordset

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have an access 2000 project in which I wrote the following code:

Private Sub updateChecksList(myTable As String)

Dim rstChecks As ADODB.Recordset
Set rstChecks = New ADODB.Recordset
Dim rstTemp As ADODB.Recordset
Set rstTemp = New ADODB.Recordset
Dim SQLString As String

With rstChecks
.Open "SELECT * from " & myTable, CurrentProject.Conncetion,
adOpenKeyset, adLockOptimistic
While (Not .EOF)
.....
Wend
End With
rstChecks.Close
End Sub


I used this kind of code many times in other projects I wrote (This project
was designed by somebody else). When the code reaches the first open line I
get the following error message: object doesn't suuport this property or
method.

Does anybody know what might be the reason?
thank you
 
dshemesh said:
Hello,
I have an access 2000 project in which I wrote the following code:

Private Sub updateChecksList(myTable As String)

Dim rstChecks As ADODB.Recordset
Set rstChecks = New ADODB.Recordset
Dim rstTemp As ADODB.Recordset
Set rstTemp = New ADODB.Recordset
Dim SQLString As String

With rstChecks
.Open "SELECT * from " & myTable, CurrentProject.Conncetion,
adOpenKeyset, adLockOptimistic
While (Not .EOF)
.....
Wend
End With
rstChecks.Close
End Sub


I used this kind of code many times in other projects I wrote (This
project was designed by somebody else). When the code reaches the
first open line I get the following error message: object doesn't
suuport this property or method.

Does anybody know what might be the reason?
thank you

Did you copy and paste that code? There's a typo on the line:
.Open "SELECT * from " & myTable, CurrentProject.Conncetion,

Should be:

.Open "SELECT * from " & myTable, CurrentProject.Connection,
 
thanks! (How stupid of me...)

Dirk Goldgar said:
Did you copy and paste that code? There's a typo on the line:


Should be:

.Open "SELECT * from " & myTable, CurrentProject.Connection,

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top