The code below works in Access 2000, not in Access 2007.
ADO returns that it supports AddNew, but when I call that method it gives me
an error: "Object or provider is not capable of performing requested
operation". That seems a contradiction.
The exact same code in the exact same ADP running on A2000 works fine.
rs.Update on existing records works fine.
Insights, anyone?
Sub TestAddNew()
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "exec SelectCandidatesForReportScoring @intExamID=4115,
@intCandidateExamID=-1, @intExamTestTypeID=1", CurrentProject.Connection,
adOpenKeyset, adLockOptimistic
'This produces expected rows
'Debug.Print rs.GetString
'This says it supports AddNew
Debug.Print "Supports AddNew: " & rs.Supports(adAddNew)
'This fails with above error.
rs.AddNew
'TODO: Fill out required fields.
rs.Update
rs.Close
End Sub
-Tom.