adCriteriaAllCols and text columns

From: John Faris (johnfaris_at_nospam.hotmail.com)
Date: 04/20/04


Date: Tue, 20 Apr 2004 11:04:45 +0100

Hi all.

Quite often we come across the situation where a user will type some notes
into a record at the exact same time that another user decides to do the
same thing at the same time. With the BDE one of the users would have got
an error back about another user changing the record. However, with ADO we
don't see the same thing. I've figured out this is because ADO defaults to
using an Update statement containg only the modified fields in the where
clause whereas the BDE would use all columns in the where clause. I read
that you can get around this by the following code in the beforepost and
beforedelete events AdoQuery1.Properties['Update
Criteria'].Value:=adCriteriaAllCols;

This does indeed populate the where clause with all columns but with the
exception of sql server text columns. So what happens is user1 changes the
notes and posts the changes whilst user2 is looking at the original notes.
Then user2 decides to add to the notes and posts them. They don't get an
error as ado has not included the text column in the where clause of the
update statement. What can be done to get around this problem?

TIA.

John.



Relevant Pages

  • Re: adCriteriaAllCols and text columns
    ... The text, ntext, and image data types cannot be compared or sorted, except ... However, with ADO ... > clause whereas the BDE would use all columns in the where clause. ... > notes and posts the changes whilst user2 is looking at the original notes. ...
    (borland.public.delphi.database.ado)
  • Re: Deleting Multiple Rows
    ... Yes - AND - being *able* to put it in the WHERE clause is very different ... updates, and deletes) are cached. ... was to create a loop in my application - wrap the loop in an ADO ... the lesser evil relative to the old nasty ADO .UpdateBatchmethod... ...
    (microsoft.public.sqlserver.programming)
  • ADO corrupts date time values in where clause
    ... talking to an Oracle database. ... Also in some cases the time component seems to be offset by 10 secs ... ado passes 00:00:10 in the where clause. ...
    (microsoft.public.data.ado)
  • DataAdapter returns 0 results, what am I doing wrong?
    ... I'm using ADO .NET to connect to a Microsoft Access database, ... LIKE clause to send queries through ADO? ...
    (microsoft.public.dotnet.languages.vb)
  • ADO.NET not retrieving results correctly
    ... I'm using ADO .NET to connect to a Microsoft Access database, ... LIKE clause to send queries through ADO? ...
    (microsoft.public.dotnet.framework.adonet)