Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6588831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:05:50+00:00 2026-05-25T17:05:50+00:00

I use the ‘updateable query’ feature of ADO, being able to select a dataset

  • 0

I use the ‘updateable query’ feature of ADO, being able to select a dataset from several tables and criteria and display it in a grid or some other UI for the user to browse and edit.

However, and I’m surprised I’ve not hit this problem before now, when one of the joined tables doesn’t have a record for the (master) key, and the user tries to edit a field in that table, ADO gives the famous “Row cannot be located..” error on post.

As far as I understand this error, the ADO driver is trying to locate the record in order to update its fields – and, of course, in this instance, there is no record to find. What I was expecting in these circumstances would be that the ADO driver would issue the equivalent of an UPDATE query for the main table, but an INSERT query for the subsidiary table.

Has anyone else come across this problem and found a workround?

The ADO driver used is the Jet 4.0 OLE DB Provider connecting to an Access (mdb) database.

I have ensured that the primary keys fields for both tables are available in the query dataset for the driver to utilise.

Here is a basic version of the SQL I have using:

SELECT 
    Table1.CustomerNo, Table1.Field1, Table1.Fieldn,  
    Table2.CustomerNo, Table2.Field1, Table2.Fieldn  
FROM 
    Table1 
LEFT JOIN Table2 
    ON Table1.CustomerNo = Table2.CustomerNo  
WHERE 
    Table1.CustomerNo = Newcode;

As an experiment, I tried the same thing in MS Access 2007, and that worked, so there maybe a solution within ADO (but then Access is probably using a different driver).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:05:50+00:00Added an answer on May 25, 2026 at 5:05 pm

    In the end, I went for the ‘hack’ solution. The updateable ADO query over 2 tables would only work if
    the customer’s reocrds existed in both tables. So, I had to check that, and if the relevant record was missing from table2, had to insert it first, before calling the main query. Here is the code:

       //Query customer account - open query from Table1 and Table2 tables                     
       TwoTableQuery.Close;
       //
       //SELECT Table2.CustomerNo
       // FROM Table2
       //WHERE (Table2.CustomerNo = CustomerCode);
       Table2Query.Close;
       Table2Query.Parameters[0].Value := CustomerCode;
       Table2Query.Open;                                /
       //does the Table2 record exist for this customer?
       if Table2Query.RecordCount = 0 then
       begin   //no, so create a new record
          Table2Query.Insert;
          Table2Query.FieldByName('CustomerNo').AsString := CustomerCode;
          Table2Query.Post;
          Table2Query.Close;
       end;
       //okay, now okay to open main query
       TwoTableQuery.Parameters[0].Value := CustomerCode;
       TwoTableQuery.Open;                                 
    

    It’s not efficient, and also creates records (in Table2) that may not be needed. But it seems the only solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

use qcvalues_test go select [finalConc] ,[rowid] from qvalues where rowid in (select rowid from
USE AdventureWorks2008R2; GO INSERT INTO myTestSkipField SELECT * FROM OPENROWSET(BULK 'C:\myTestSkipField-c.dat', FORMATFILE='C:\myTestSkipField.fmt' ) AS
Use case: 3rd party application wants to programatically monitor a text file being generated
We use a data acquisition card to take readings from a device that increases
Use Eclipse Classic with ADT plugin. Tried to make project from existing example of
use PHP and MySQL and want to use SELECT statement which date_post(datetime variable) start
Use Html element SELECT in aspx page like: <SELECT id=MySelection name=MySelection runat=server DataValueField=ID DataTextField=Name></SELECT>
use PHP and MySQL. Want my website to have the feature of image uploading
use DBI(); What is causing this insert to fail to err 1, the SELECT
'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.