MerlaP83
asked on
Firebird+Delphi 7 Problem with 0 results found
Hey all,
Provided some code before which I use to update a record in my Firebird database; however, sometimes the main_boost.caption isn't found in the db (which is correct, not every entry is in the db) - and if a record isn't found then nothing should happen, if the record is found however then the Edit/Post procedure should begin.
Provided some code before which I use to update a record in my Firebird database; however, sometimes the main_boost.caption isn't found in the db (which is correct, not every entry is in the db) - and if a record isn't found then nothing should happen, if the record is found however then the Edit/Post procedure should begin.
Lag.close;
Lag.sql.text := 'select * from lag where klubb = '''+main_boost.caption+'''';
Lag.Open;
Lag.First;
Lag.Edit;
Lag['Off'] := inttostr(strtoint(Lag['Off']) - 3);
Lag['Def'] := inttostr(strtoint(Lag['Def']) - 3);
Lag.Post;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you.
Which solution would you prefer?
The first solution gave me Undeclared identifier on Prepare, Parambyname, ExecuteSQL and AffectedRecords (Using Firebird+Zeos). The second solution worked perfect.
Which solution would you prefer?
The first solution gave me Undeclared identifier on Prepare, Parambyname, ExecuteSQL and AffectedRecords (Using Firebird+Zeos). The second solution worked perfect.
well most certainly try and do as many changes with a update statement
don't have zeos here atm, i'll have to check that tomorrow ...
i'm guessing:
ParamByName('X') should be Parameters.ParamByName('X)
ExecuteSql should be Execute
...
but this is for sample 1:
send script to server (some 100 bytes over network)
let server execute script
server returns number of records (some 10 bytes over network)
sample 2:
send script to server (some 100 bytes over network)
server returns the dataset (if any, probably 100 bytes per record)
dataset copies this set to memory
for each record
you check the record in memory
you edit the data locally
you tell the server the record changed (probably 100 bytes per record)
server returns number of records affected (some 10 bytes over network)
do you understand why you need to go for script 1 ?
don't have zeos here atm, i'll have to check that tomorrow ...
i'm guessing:
ParamByName('X') should be Parameters.ParamByName('X)
ExecuteSql should be Execute
...
but this is for sample 1:
send script to server (some 100 bytes over network)
let server execute script
server returns number of records (some 10 bytes over network)
sample 2:
send script to server (some 100 bytes over network)
server returns the dataset (if any, probably 100 bytes per record)
dataset copies this set to memory
for each record
you check the record in memory
you edit the data locally
you tell the server the record changed (probably 100 bytes per record)
server returns number of records affected (some 10 bytes over network)
do you understand why you need to go for script 1 ?
Open in new window