🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #3003

Re: ADO Problem - "Row cannot be located ... "

#3003
From: Ian Hood
Date: Wed, 22 Jan 2003 01:11
101 lines
3848 bytes
Thanks for your reply Vassiliev.

Vassiliev V.V. wrote:
> #include <comobj.hpp>
> 
> namespace System
> {
>  void __fastcall CheckSafecallResult(HRESULT hr)
>  {
>   OleCheck(hr);
>  }
> }
> 

Firstly, I don't really understand what this code is all about but I'm 
assuming I should place it at the top of the unit in question.  It seems 
to compile alright, however ...

> ...
>  ADODataSet1->Properties->Item["Update Criteria"]->Value = adCriteriaKey;
> 

this line did not.  It generated the following compile errors.

E2034 Cannot convert 'char *' to OleVariant'
E2342 Type mismatch in parameter 'Index' (wanted 'const OleVarient', got 
'char *')
E2451 Undefined symbol 'adCriteriaKey'

I used the following:

ADODataSet1->Properties->Item[WideString("Update Criteria")]->Value = 
adCriteriaKey;

which got rid of the first two errors but the last is still a mystery.

I found that "adCriteriaKey" was defined in a number of header files 
including adoint.h, however by including this file I got dumped with all 
sorts of problems including multiple declarations and scope ambiguity 
errors.

Any further enlightenment on this would again be much appreciated.


Regards,

Ian.





> ----------------------------------------------------------------
> Regards,
> Viatcheslav V. Vassiliev
> http://www.oledbdirect.com
> The fastest way to access MS SQL Server, MS Jet (MS Access)
> and Interbase (LCPI provider, http://ibp.lcpi.lipetsk.ru) databases.
> 
> "Ian Hood" <ian@ravar.net> �������/�������� � �������� ���������:
> news:3e2cb1ca@newsgroups.borland.com...
> 
>>Hello all.
>>
>>I am having an ADO problem in the guise of frequent EOleExceptions with
>>message 'Row
>>cannot be located for updating. Some values may have been changed since it
>>was last read'.
>>
>>I've narrowed the problem to the fact that the default for AdoExpress
>>datasets is to locate the record to update on all field values
>>(adCriteriaUpdCols). So if you change a row in
>>one dataset all the field values no longer match when you try to update it
>>from the second dataset. That is why I keep getting the fail messages.
> 
> I've
> 
>>also seen the problem even
>>if there is only one dataset open!!
>>
>>To solve this problem, I have to set the 'Update Criteria' dynamic
> 
> property
> 
>>to adCriteriaKey, which tells the dataset to use only the Primary Key to
>>locate the record.
>>
>>In Delpi, this is done as follows:
>>
>>ADODataSet1.Properties['Update Criteria'].value :=adCriteriaKey;
>>
>>My problem is working out how to implement the above line in C++.
>>
>>Any help in this matter will be much appreciated.
>>
>>Ian.
>>
>>
> 
> 
> 
Technical Details
Message-ID: <3E2DEFC6.2010706@ravar.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.online.be!fu-berlin.de!news.boerde.de!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!newsgroups.borland.com!not-for-mail
References: <3e2cb1ca@newsgroups.borland.com> <3e2cf3fc@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,e558d2dad24464a
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-01-21 17:06:07 PST
Message-ID: <3E2DEFC6.2010706@ravar.net>
Date: Wed, 22 Jan 2003 11:11:34 +1000
From: Ian Hood <ian@ravar.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: ADO Problem - "Row cannot be located ... "
References: <3e2cb1ca@newsgroups.borland.com> <3e2cf3fc@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 203.51.204.220
X-Trace: newsgroups.borland.com 1043197466 203.51.204.220 (21 Jan 2003 17:04:26 -0800)
Lines: 104
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.online.be!fu-berlin.de!news.boerde.de!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!newsgroups.borland.com!not-for-mail