good programming practise - controls and DBs

12-06-2002, 03:48 AM

I have a small problem with the application I am busy with.I have and
msflexgrid and before the form exists it saves the selected row to the DB
using an update statement, this db entry is used in the next form and is
requested using a select statement. My problem is that sometimes the update
takes longer than the other form loading and selectinmg the Db entry
therefore it doesnt get selected. I need some advice on which controls to
use to ensure that the appropriate time is taken to let the update statement
take place and therefore the correct info selected. Should I make use of a
different mouse cursor? or should i make a small form with a progress bar on
it? But what I am trying to get my head around is the following: how do I
know when the statement is completely updated?is there anyway of determining
from the DB when it is complete? I am using and access database and
ADO.Another factor is also when the db increases will it affect the
update/insert time??

thanx in advance!



12-06-2002, 04:53 AM
Hi zann,

Have not you tried DoEvents statement to insure that?


12-06-2002, 04:54 AM
1- When the db becomes huge, of course, performance worsen.
I don't think there is any better practice than compacting often.

2- I think there is a property value when a record is changed.
However, this helps only when the application works with only
one single record or batch of records. There is no way to check
for the completeness of a command. Please, do not take my
word for that. I am eager to see anyone offering better ideas.

12-06-2002, 05:52 AM
No, I actually have never heard of it. Is it possible for you to give me a peice of example code so that i can see how it works and I can understand it. Thanx a million I really appreciate it!

12-06-2002, 06:56 AM
This is in the General section:
Dim RecSet As ADODB.Recordset

Please, place it in Timer or event that checks time periodically:
If any of these:
RecSet.State = adStateOpen
RecSet.State = adStateClosed
RecSet.State = adStateConnecting
RecSet.State = adStateExecuting
RecSet.State = adStateFetching
Then give user a feedback.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum