I just put in "SELECT * FROM [Checking] ORDER BY [Index];". I am not sure of the syntax.
My connection String works fine.
I rarely update this. It may be once a week or two.
The error code I am getting is:
Error #:-2147217887
Field cannot be updated.
It does not specify which field. Here is an excerpt from my code:
Code:
rs.Open "SELECT * FROM [Checking] ORDER BY [Index];", ActiveConnection:=cn, _
CursorType:=adOpenKeyset, LockType:=adLockOptimistic, _
Options:=adCmdText
rs.MoveFirst
For k = 1 To Sheets("2013").Cells(Rows.Count, "A").End(xlUp).Row - 4
If rs!Index <> k Or rs!total <> Sheets("2013").Cells(k + 4, 5).Value Then
rs!Index = Sheets("2013").Cells(k + 4, 1).Value
rs!DatePaid = Sheets("2013").Cells(k + 4, 2).Value
rs!WhatPaid = Sheets("2013").Cells(k + 4, 3).Value
rs!AmtPaid = Sheets("2013").Cells(k + 4, 4).Value
rs!total = Sheets("2013").Cells(k + 4, 5).Value
rs!AmtRec = Sheets("2013").Cells(k + 4, 6).Value
rs!WhatRec = Sheets("2013").Cells(k + 4, 7).Value
rs!DateRec = Sheets("2013").Cells(k + 4, 8).Value
rs.Update
End If
rs.MoveNext
Next k