Solved

Insufficient base table err updating ADO record

Posted on 2004-04-12
6
425 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
  • 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 69

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

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 69

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now