Re: Row cannot be located for updating

From: Carl (carlallen30229_at_hotmail.com)
Date: 08/16/04


Date: Mon, 16 Aug 2004 15:23:05 -0400

Yes, I have a single column meaningless integer key for each table. That's
what has me baffled. I was about to resort to submitting the SQL myself,
using the statement that you showed below.

Is there a way to set the ADO components so that they just use the key to
find the record?

"Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
news:412053e9$1@newsgroups.borland.com...
> 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: SQL Express - Identity specification property - how to change
    ... FOO_ID int identity, ... Tony Rogerson, SQL Server MVP ... They are making unfortunately frequent use of the IDENTITY column in conjunction with Primary Key. ... IDENTITY has none of the properties of a data type because it is not a data type at all. ...
    (comp.databases.ms-sqlserver)
  • Re: Binding and adding rows with SQL identity column
    ... Each time you call AddNew then the DataTable generates a new ... Each time an update is done then the real primary key ... > generated by the built-in wizard in VS2003. ... > identity column on the sql table, perhaps this would all the fine and I ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: What happens after 2^32 autonum keys are exhausted?
    ... Tony Rogerson, SQL Server MVP ... generated primary key despite the risk of a hardware or software error or a fault in the space-time continuum. ... identifier and have to invent one, follow the data design (data ...
    (comp.databases)
  • Re: sliced find in Linq
    ... by over all of the returned columns. ... Since the original query was unordered, I'd like the above SQL to ... (Perhaps your table doesn't have a primary key though?) ... didn't specify the ordering, so any ordering could have been used. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Can a query find info X numbr of rows from target info?
    ... "Ann Scharpf" wrote: ... > each row is sequentially numbered, giving me the desired explicit sort order. ... > an exact comparison between my SQL & your advice. ... Do you have Row names (Primary Key). ...
    (microsoft.public.access.queries)