beginner81
Programmer
Can i know what's the code to check whether a record is exist in the database or not ??
The database server that i'm using is MsSQL .. and i had link it wif the following way :
TSQLConnection -> TSQLQuery -> TClientdataset
I's using TClientdataset to hold the data and update it to the database (once the user click at Update button)..
Anyway, i can't hav same record field (must b unique field eg CustID) in the database .. so i need to do the checkin
in the database instead of TClientdataSet (cos some of the time the TClientdataset data will b clear after it has been updates to database..
so instead of doin the checkin in TClientdataset b4 it has been updating to database, i need to do the checking in
Database.. so what code should i put ??
Here is the code that i's doin the checkin on TClientdataset..
Code for do the checking in TClientDataSet:
if NOT TClientDataSet.Locate('ProductID', [TEditProductID.Text], []) then // check whether it's in the TClientdataset or not
P/S:Something wrong wif the syntax i guess..
but all i want to do now
is to do the checking on Database instead of TClientdataset ... can anyone help me...
Thx in advance..
The database server that i'm using is MsSQL .. and i had link it wif the following way :
TSQLConnection -> TSQLQuery -> TClientdataset
I's using TClientdataset to hold the data and update it to the database (once the user click at Update button)..
Anyway, i can't hav same record field (must b unique field eg CustID) in the database .. so i need to do the checkin
in the database instead of TClientdataSet (cos some of the time the TClientdataset data will b clear after it has been updates to database..
so instead of doin the checkin in TClientdataset b4 it has been updating to database, i need to do the checking in
Database.. so what code should i put ??
Here is the code that i's doin the checkin on TClientdataset..
Code for do the checking in TClientDataSet:
if NOT TClientDataSet.Locate('ProductID', [TEditProductID.Text], []) then // check whether it's in the TClientdataset or not
P/S:Something wrong wif the syntax i guess..
but all i want to do now
is to do the checking on Database instead of TClientdataset ... can anyone help me...
Thx in advance..