Re: MSAccess and ADO

From: Andrew (abaylis_nos_at_spamcop.net)
Date: 03/14/05


Date: Mon, 14 Mar 2005 10:21:15 +1100


"Stanko Milosev" <stanko@-no-s-pa-mmilosev.co.yu> wrote in message
news:423379c5@newsgroups.borland.com...
> Thank you for answering Andrew,
> .
> I need to show reports from ADOQuery, mostly, for all changes I do in
> database I use TADOQuery and SQL
>

In that case, I recommend:
i) Use ADOQuery.DisableControls/EnableControls around calls that move the
cursor position more than once (eg: scrolling through a recordset and
collecting data)

ii) If you want to modify data, use:
LockType = ltBatchOptimistic and UpdateBatch/CancelBatch. If doing more than
one move / update, this really improves performance (eg: on 200 moves / edit
/ post cycles I went from 2250 ms with the default settings to 63 ms in
batch mode + DisableControls)
Interestingly, using a TADOCommand object to do the data update only dropped
the time from 2250 ms to 1078 ms - a useful improvement, but not as
spectacular as Batch mode.

HTH

Andrew

> "Andrew" <abaylis_nos@spamcop.net> wrote in message
> news:42337364$1@newsgroups.borland.com...
>> "Stanko Milosev" <stanko@-no-s-pa-mmilosev.co.yu> wrote in message
>> news:4232ecc8@newsgroups.borland.com...
>> > For best performance, how ADO should be set up? I guess, cursor server
>> > side,
>> > what further?
>> >
>> Depends a bit on what you want to do...
>>
>> Best performance for tables is CommandType = cmdTableDirect,
>> CursorLocation=clUseServer
>>
>> For changing data in tables, the best performance I've found is to use
>> the
>> Execute method of ADOCommand objects with the appropriate Insert / Update
> /
>> Delete SQL and ExecuteOptions = [eoExecuteNoRecords]
>>
>> HTH
>> Andrew



Relevant Pages