Board index » delphi » Re: ADOQuery NOT doing Update

Re: ADOQuery NOT doing Update


2006-02-10 09:57:51 PM
delphi119
paul mayer writes:
Quote
Im trying to do a simple sql update. I do the update the first time
and its fine. I change a value and do it again, no change made.
Now, if I single step through, it does the update.

I do the update in database explorer and it works fine. There is no
error at all, as I know because delphi is set to stop on an
exeception.

And yes, the value of the second update is different

Whats going on here please


Paul M
what Delphi and MDAC version? How does the SQL sentence look like? Are
you using Open or ExecSQL to do the update?
--
Best regards :)
Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com
 
 

Re: ADOQuery NOT doing Update

Im trying to do a simple sql update. I do the update the first time and its
fine. I change a value and do it again, no change made.
Now, if I single step through, it does the update.
I do the update in database explorer and it works fine. There is no error
at all, as I know because delphi is set to stop on an exeception.
And yes, the value of the second update is different
Whats going on here please
Paul M
 

Re: ADOQuery NOT doing Update

Quote
what Delphi and MDAC version? How does the SQL sentence look like? Are
you using Open or ExecSQL to do the update?
OS is XP Pro
Delphi 7 pro
The Access driver version is 4
Here is the SQL followed by the code. I'd call the code the second time
with say a change to LoggedInNow, which is boolean. Its works fine if I
single step. Maybe I should try it outside the IDE, but I should not have
to.
UPDATE tblUser SET CreationDate = '03/02/2005', FriendlyName = 'BLANK',
ObjectDeleted = False, UserName = 'Tony Benyon', UserPassword = 'user',
LoggedInNow = True, LastLoginDate = '10/02/2006', LastLoginTime =
'15:09:15', LastLogoutDate = '10/02/2006', LastLogoutTime = '14:25:13',
Department = '?', AccessLevel = 3, MachineLogin = 'PHILC' WHERE ObjectID =
4
try
ADOQuery.Close;
ADOQuery.Prepared := False;
ADOQuery.SQL.Clear;
ADOQuery.ConnectionString := FADOConnectionString;
ADOQuery.SQL.Add(strUpdateSQL);
ADOQuery.Prepared := True;
ADOQuery.ExecSQL;
ADOQuery.Close;
except
Result := False;
end;
 

Re: ADOQuery NOT doing Update

paul mayer writes:
Quote

There are no ADO connection components, just 1 connection string to 1
ado query component. Outside the IDE, it still does not do the
update, but does not come up with any exception.
i'm not really sure if that makes any difference but I'd try using
an ADOConnection. OTOH, it maybe you're using cached updates, although
i'm not sure if without using an ADOConnection that is possible.
You told us also that you are using MS JET 4.0 but not which MDAC
version. Maybe the problem lies there...
--
Best regards :)
Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com
 

Re: ADOQuery NOT doing Update

The problem doesnt occur if I put the thread to sleep for 500 ms but that
is a hack.
I will sleep badly not knowing why this is happening, and knowing that I
have had to resort to using the sleep hack.
Paul M
 

Re: ADOQuery NOT doing Update

"paul mayer" <XXXX@XXXXX.COM>???????/???????? ? ???????? ?????????:
Quote
The problem doesnt occur if I put the thread to sleep for 500 ms but that
is a hack.

I will sleep badly not knowing why this is happening, and knowing that I
have had to resort to using the sleep hack.

Paul M
Change takes place, but it is flushed to the disck and thus became visible
to the other ADO connections after the small delay (this is how MS Jet
works), so to sleep well just use single ADO connection for all data access
components in yours app.
 

Re: ADOQuery NOT doing Update

Quote
Change takes place, but it is flushed to the disck and thus became visible
to the other ADO connections after the small delay (this is how MS Jet
works), so to sleep well just use single ADO connection for all data access
components in yours app.
There are no ADO connection components, just 1 connection string to 1 ado
query component. Outside the IDE, it still does not do the update, but does
not come up with any exception.
 

Re: ADOQuery NOT doing Update

"paul mayer" <XXXX@XXXXX.COM>???????/???????? ? ???????? ?????????:
Quote

>Change takes place, but it is flushed to the disck and thus became
>visible
>to the other ADO connections after the small delay (this is how MS Jet
>works), so to sleep well just use single ADO connection for all data
>access
>components in yours app.

There are no ADO connection components, just 1 connection string to 1 ado
query component. Outside the IDE, it still does not do the update, but
does
not come up with any exception.
Same holds true for "outside the IDE" (whatever do you mean by that), since
it is different connection from connection where you are doing update, thus
changes will be visible after some delay.
 

Re: ADOQuery NOT doing Update

Quote
i'm not really sure if that makes any difference but I'd try using
an ADOConnection. OTOH, it maybe you're using cached updates, although
i'm not sure if without using an ADOConnection that is possible.

You told us also that you are using MS JET 4.0 but not which MDAC
version. Maybe the problem lies there...
I will try the Connection on monday. I dont know how to find out about the
MDAC version.
Here in the UK we are ready to finish work. Have a good weekend guys
 

Re: ADOQuery NOT doing Update

support.microsoft.com/ follow the link to determine MDAC
version you are running
hth,
brian
--
Got a big event coming up? Let us
help coordinate your event. For more
visit www.kissemgoodbye.com
"paul mayer" <XXXX@XXXXX.COM>writes
Quote

>i'm not really sure if that makes any difference but I'd try using
>an ADOConnection. OTOH, it maybe you're using cached updates, although
>i'm not sure if without using an ADOConnection that is possible.
>
>You told us also that you are using MS JET 4.0 but not which MDAC
>version. Maybe the problem lies there...

I will try the Connection on monday. I dont know how to find out about the
MDAC version.

Here in the UK we are ready to finish work. Have a good weekend guys
 

Re: ADOQuery NOT doing Update

On Fri, 10 Feb 2006 13:23:12 -0500, Brian Hollister writes:
Quote
support.microsoft.com/ follow the link to determine MDAC
version you are running

hth,

brian
I ran the check and I have MDAC 2.8 and SP2 installed on XP Pro. Whether
this is of any use to you I dont know. The problem still persists. Any
ideas much appreciated
Thanks