Re: Row cannot be located for updating

From: Viatcheslav V. Vassiliev (support_at_oledbdirect.com)
Date: 08/16/04


Date: Mon, 16 Aug 2004 10:27:44 +0400

Do you have primary key in every table affected by delete? Deleting some
rows may occur if there is no primary key, because ADO execute query:

DELETE FROM [SomeTable] WHERE ....

If there is no primary key, WHERE may select some rows.

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Carl" <carlallen30229@hotmail.com> сообщил/сообщила в новостях следующее:
news:412052ce@newsgroups.borland.com...
> In this instance, I'm just building a desktop application. Would some
other
> settings be more appropriate? Should I use a server side cursor? Is there
a
> way to set the SQL generation to just use the key?
>
> I've also seen some problems with "delete". I delete one record and when I
> reopen my app I find that two have been deleted instead. What would cause
> this?
>
>
> "Brian Bushay TeamB" <BBushay@Nmpls.com> wrote in message
> news:gf00i01rnqv2siupqa6gpdahvabagdhmcc@4ax.com...
> >
> > > I' using Delphi 7 with ADO components with an Access database. I have
> been
> > >sporadically getting a "Row cannot be located for updating" error. I'm
> not
> > >able to reproduce it, although it occurs most often when I'm trying to
> > >delete a record. What causes this error? What can I do to prevent it?
> >
> > When you use clientside cursors and make changes or delete a record in
the
> > client ADO needs to Generate SQL to update (or delete) the Record in
your
> > database. To do this it must be able to find the record in your
database
> that
> > corresponds to the record you are editing.
> > The error message you are getting indicates that ADO can not find the
> record to
> > be deleted.
> > The default for ADO generating SQL is to use all the fields and values
you
> > originally queried from the database to find the in your database.
> > If you have triggers that update your records or with some databases
> DateTime
> > fields where miliseconds get truncated the values of your clientdataset
> may not
> > match the records in your database after an initial edit.
> >
> >
> >
> > --
> > Brian Bushay (TeamB)
> > Bbushay@NMPLS.com
>
>



Relevant Pages

  • Re: Accesss ADP
    ... different name, upload it to the server, and when it was finished uploading, ... so that it would overwrite the original database ... I know that there's a SQL button somewhere in there. ... It doesn't have to be a primary key - ...
    (comp.databases.ms-sqlserver)
  • Re: Creating tables
    ... Frederico has recommended you to replace the solution with an ADO one. ... DAO is "Data Access Objects". ... direct interface to the database engine and it is being implemented in open ... SQL Server with stored procedures and triggers, ...
    (comp.lang.cobol)
  • Re: Databases - DAO and ADO
    ... I surely would go in your situation for Ado recordset and try to use simply a freeware SQL Server Express ... Around the Ado recordset is still pretty much documentation, DAO is fast but the documentation on Internet is poor. ... A couple programmers here suggested that I use a database instead and SQL to query this database. ... So with those recommendations in mind, I have spent the last few weeks reading books on VB6 Database programming and skimming the web for information on creating databases, etc. I'm confronted with choices that are quite frankly confusing me. ...
    (microsoft.public.vb.general.discussion)
  • Re: Databases - DAO and ADO
    ... Around the Ado recordset is still pretty much documentation, ... Have a look at this one to and use SQL Server Express like the Jet ... A couple programmers here suggested that I use a database instead and SQL ... Because most of the books on VB6 are old now, ...
    (microsoft.public.vb.general.discussion)
  • Re: PostgreSQL
    ... In general any SQL database will handle all of those things better. ... This is VERY important ALWAYS make sure you have a PRIMARY key in each ... Having a sever database engine opens up a lot of options. ...
    (comp.lang.clarion)