?
Solved

Insufficient base table err updating ADO record

Posted on 2004-04-12
6
Medium Priority
?
431 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 500 total points
ID: 10809611
UNIONed queries cannot be updated because ADO won't know which query to update.
0
Independent Software Vendors: 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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

771 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