Solved

Insufficient base table err updating ADO record

Posted on 2004-04-12
6
429 Views
Last Modified: 2008-03-03
Hello all,

When using the update property of a ADO Recordset, I am getting the following error:
Runtiime error '-2147467259 - Insufficient base table information for updating

I was ok sometimes and sometimes not. I figured it out when it happens. It only errs when I update on a record retreived using a select stmt containing UNION.

Can you help me with resolving this problem? Thank you.
Phil

I am using to open the recordset:
lstg.Open lstgSel, cnAgent, adOpenKeyset, adLockOptimistic

and the following for the update:
Private Sub scrn_Note_GotFocus()
   saveNote = scrn_Note.Text
End Sub

Private Sub scrn_Note_LostFocus()
   If saveNote <> scrn_Note.Text Then
        lstg!NOTE = scrn_Note.Text
        lstg.Update
   End If
End Sub
0
Comment
Question by:spoowiz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 10808827
That would be because it is a Read-Only resultset.  Make the following change and see for yourself:

lstg.Open lstgSel, cnAgent, adOpenKeyset, adLockOptimistic
Debug.Print (lstg.LockType = adLockReadOnly)

and the following for the update:
Private Sub scrn_Note_GotFocus()
   saveNote = scrn_Note.Text
End Sub

Private Sub scrn_Note_LostFocus()
   If saveNote <> scrn_Note.Text Then
        lstg!NOTE = scrn_Note.Text
        lstg.Update
   End If
End Sub
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 10808847
Also, please maintain these old open questions:
1 02/20/2004 250 How to Sort data in Form created by Form...  Open Microsoft Access
2 02/25/2004 125 TCP/IP Error in window 2000  Open Networking
3 02/25/2004 50 ASP.NET and MySQL/ASP and MySQL  Open Mysql
4 03/04/2004 500 Linked Table to dbase file has bad field...  Open Microsoft Access
5 03/04/2004 500 Opening dbase file (.dbf) from VB  Open Visual Basic
6 03/05/2004 500 Please HELP. URGENTLY need help from VB-...  Open Visual Basic
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 125 total points
ID: 10809611
UNIONed queries cannot be updated because ADO won't know which query to update.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:spoowiz
ID: 10809652
acperkins - thanks. i'm cleaning them up now. last 2 weeks was bad due to family emergency.
i don't understand your solution. it looks the same as my original? my original is not read-only, is it?
emoreau - dosn't UNIONed query generate one ADO resultset? you must be right, the behavior supports your explanation. so the workaround is to open another recordset with the one record and update it?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 10809666
>>dosn't UNIONed query generate one ADO resultset?

Sure. All the record from all the UNIONed queries are joined together to look like a single record.

>>so the workaround is to open another recordset with the one record and update it?

I would prefer doing a direct SQL action query:
YourConnection.Execute "UPDATE TableX Set YourFieldName = YourNewValue"
0
 

Author Comment

by:spoowiz
ID: 10809784
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question