PRB: Error Updating adUseClient Cursor Based on MDB Query
ID: Q190108
|
The information in this article applies to:
-
ActiveX Data Objects (ADO), versions 1.5, 2.0, 2.1 SP2
SYMPTOMS
Trying to update a client-cursor, generated by calling a QueryDef from an
MDB causes the following error to appear:
Run-time error '-2147467259(80004005)':
Insufficient base table information for updating or refreshing.
CAUSE
Jet does not provide metadata or base table information through
IcolumnsRowset. The only other option would be to parse the SQL statement
for the metadata. However, it is not possible to parse a stored procedure
call.
RESOLUTION
Use a server-side cursor or a straight SQL statement to open the recordset.
STATUS
This behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
- Create a user DSN that points to the Nwinds.mdb file.
- Create a "Standard EXE" project in Visual Basic.
- On the Project menu, click References, and select Microsoft ActiveX Data Objects Library.
- Copy and paste the following code into the default form.
Dim con As ADODB.Connection
Dim com As ADODB.Command
Dim res As ADODB.Recordset
Dim par As ADODB.Parameter
Set con = New ADODB.Connection
Set com = New ADODB.Command
Set res = New ADODB.Recordset
con.ConnectionString = "dsn=nwind;usid=admin;pwd=;"
' Comment the next line to go around the Update error
con.CursorLocation = adUseClient
con.Open
set com.ActiveConnection = con
com.CommandText = "{call Invoices}"
com.CommandType = adCmdText
res.Open com, , adOpenStatic, adLockOptimistic, -1
res(1) = "test"
res.Update 'This line causes the error.
res.Close
con.Close
Set res = Nothing
Set com = Nothing
Set con = Nothing
Additional query words:
kbDSupport kbado kbVBp600 kbMDAC200 kbDatabase kbgrpvbdb kbgrpmdac kbmdac210sp2 kbjet kbado210sp2
Keywords : kbGrpVBDB kbGrpMDAC kbDSupport
Version : WINDOWS:1.5,2.0,2.1 SP2
Platform : WINDOWS
Issue type : kbprb