Re: FK Relation

From: Brian Bushay TeamB (BBushay_at_Nmpls.com)
Date: 11/25/04


Date: Wed, 24 Nov 2004 22:10:22 -0600


>Yes the detail table has cascading delete too(at database level).
>The database it´s sql server 2000.
>if I do the delete of master table with Access 2000 al work fine.
>The error "cannot find row for update, some values changes from the last
>read" I´m sorry it´s traslate from spanish.
>I use to connect ADO and OLEDB provider for sql server.

Do you have any triggers on the Master table that update the master based on
detail records?
Borland's ADO components use all the fields in the record's selected fields to
find the record to update (in this case) delete. The error you are getting
indicates that when ADO tries to find the record to delete there is not one in
the database with the field values the same as what you have in your
TadoDataset. You could try changing Update Criteria.

ADODataSet1.Properties['Update Criteria'].value :=adCriteriaKey;
You can put this code in the BeforeDelete event. (You need to add ADOInt to
your USE)

This code will force ADO to use just the key field values to locate the record
to be deleted.

Access 2000 may be handling Update criteria this way or it may be using a client
side cursor.

--
Brian Bushay (TeamB)
Bbushay@NMPLS.com


Relevant Pages

  • Re: Access and processor usage
    ... "increased bandwidth" using ADO. ... bottleneck - need to step up to Sql Server. ... If the data fits into a 2 GB database file, ...
    (comp.databases.ms-access)
  • Re: How to access the SQL server express from mfc application?
    ... There are different ways to do this via MFC. ... You could certainly try ADO, ... the entire contents of the database to a SQL Server Standard Server. ...
    (microsoft.public.vc.mfc)
  • Re: unable to start SQL Service ... error code 3417
    ... How about just create a new instance and restore databases to the new instance? ... I wouldn't go with restoring master from another instance. ... The supported route is to rebuild your master database, start SQL Server in single user mode, ...
    (microsoft.public.sqlserver.server)
  • Re: Connecting to a SQL Server 2005 using VBA and ADO
    ... dao should work just fine.... ... the above example when using sql server, or a plan Jane un-split database, ... I would not use findfirst even when not using sql server unless the data set ... Microsoft since they now seem to be favoring ADO. ...
    (microsoft.public.access.formscoding)
  • Re: OTHER BIG BUG : deleting detail master delete
    ... database and i want to delete 'simple' a detail record in a table, ADO ... In a master detail relation with transaction and batchoptimistic ...
    (borland.public.delphi.database.ado)