Microsoft KB Archive/190108

From BetaArchive Wiki

Article ID: 190108

Article Last Modified on 5/17/2007



APPLIES TO

  • Microsoft ActiveX Data Objects 1.5
  • Microsoft ActiveX Data Objects 2.0
  • Microsoft ActiveX Data Objects 2.1 Service Pack 2



This article was previously published under Q190108

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 problem has been corrected in Microsoft Data Access Components versions 2.5 and later. You may download the latest version of the Microsoft Data Access Components from the following site:

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a user DSN that points to the Nwind.mdb file.
  2. Create a "Standard EXE" project in Visual Basic.
  3. On the Project menu, click References, and select Microsoft ActiveX Data Objects Library.
  4. Copy and paste the following code into the formForm_Load()event.

       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


Keywords: kbado260fix kbbug kbdatabase kbfix kbjet kbmdacnosweep kbnoupdate KB190108