What am I doing wrong here? I'm trying to update one
field in a table. This compiles okay, but I'm getting a run-time error on the "rs.Open":
Error number -2147217904 (80040e10)
No value given for one or more required parameters.
I'm used to DAO, not ADO, but thought I'd give it a
try. I've been fooling with this for at least an hour,
just can't see what the problem is. Any help much
appreciated. Thanks.
field in a table. This compiles okay, but I'm getting a run-time error on the "rs.Open":
Error number -2147217904 (80040e10)
No value given for one or more required parameters.
I'm used to DAO, not ADO, but thought I'd give it a
try. I've been fooling with this for at least an hour,
just can't see what the problem is. Any help much
appreciated. Thanks.
Code:
Sub Update_SeqNo()
Dim rs As ADODB.Recordset
Dim cnn As ADODB.Connection
Dim strSql As String
Dim Cnt As Integer
strSql = "Select * from AdAgeSort Order by Country, Zip, Bus-Ind, Ttl-Code;"
Debug.Print strSql
Set cnn = CurrentProject.Connection
Set rs = New ADODB.Recordset
rs.Open Source:=strSql, _
ActiveConnection:=cnn, _
CursorType:=adOpenForwardOnly, _
LockType:=adLockPessimistic, _
Options:=-1
Cnt = 0
While Not rs.EOF
Cnt = Cnt + 1
rs!SeqNo = Cnt
Wend
rs.Close
Set rs = Nothing
cnn.Close
Set cnn = Nothing
End Sub