🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TADOTable and data-aware components, or TADO Command?

#2130
From: Jason Shrapnel
Date: Thu, 13 Nov 2003 00:02
55 lines
3359 bytes
Thanks for the info!

That website was an interesting read and did give some insight into what is
going on and why that error message is being generated - thankyou!

I have set the Update Criteria property of the query to adCriteriaKey at
runtime, but am now unsure of what lock type to use. The web site you gave
states that you can't use optimistic locking with this setting. This being
the case, what lock type should be used? MYSQL does not support pessimistic
locking and the only other options are OptimisticBatch or ReadOnly. I have
tried OptimisticBatch but when using this lock type nothing seems to get
updated. I post with no errors but the changes are not seen in the database.
ReadOnly is also, obviously, unsuitable.

Does setting the locktype to Optimistic over-ride the Update Criteria
property that you set at run-time? If I leave the locktype to Optimistic I
get that same "row cannot be located" error when trying to edit blank date
fields. This is confusing since, from what I understood, using the
adCriteriaKey setting only the primary key field should be used when trying
to locate the correct record. I have the primary key correctly set up in
MYSQL, do I also have to explicitly state it somewhere in the code for this
to work?

Thanks again for the help,
Jason Shrapnel
Invarion Pty Ltd


"Mark Guerrieri" <mguerrieri@cmsgrp.com> wrote in message
news:3fb27f49$1@newsgroups.borland.com...
> I think the problem lies in the fact that the myODBC provider does not
> correctly handle TDateTime values in parameterized queries.  When you
Post,
> ADO is internally creating a parameterized SQL update command that
includes
> all your SELECT fields in the WHERE clause, to make sure the record has
not
> changed since you queried it.  There are dynamic ADO proerties you can set
> on the TADOQuery object to tell ADO to only use the primary key in the
WHERE
> clause when updating, but you loose the oportunistic locking.  You can try
> setting the "Update Criteria" property to adCriteriaKey for starters.  see
> the following site for a great description of how ADO updating works and
how
> you can customize it:
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvbdev00/html/vb00e1.asp
>
> Hope this helps-
>
> Mark
>
>
>
Technical Details
Message-ID: <3fb2ca06$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3faacfde@newsgroups.borland.com> <3fadac99$1@newsgroups.borland.com> <3fb16707$1@newsgroups.borland.com> <3fb27f49$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,576fb9af2138d9fa
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-11-12 16:09:38 PST
From: "Jason Shrapnel" <jason@invarion.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3faacfde@newsgroups.borland.com> <3fadac99$1@newsgroups.borland.com> <3fb16707$1@newsgroups.borland.com> <3fb27f49$1@newsgroups.borland.com>
Subject: Re: TADOTable and data-aware components, or TADO Command?
Date: Thu, 13 Nov 2003 11:02:15 +1100
Lines: 57
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 202.174.228.150
Message-ID: <3fb2ca06$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1068681734 202.174.228.150 (12 Nov 2003 16:02:14 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail