?
Solved

Insufficient base table err updating ADO record

Posted on 2004-04-12
6
Medium Priority
?
434 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

650 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