Solved

Insufficient base table err updating ADO record

Posted on 2004-04-12
6
430 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

724 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