Board index » delphi » Re: TIBCustomDataSet.ModifySQL?

Re: TIBCustomDataSet.ModifySQL?


2003-07-03 09:52:41 AM
delphi185
I think IBDataset is like a Ttable, so all you need to do is
samethink like this
if not Mytibtransaction.intransaction then
MyTIBTransaction.StartTransaction;
MyTibdataset.edit; //
confirm that is in edit mode
MyTibdataset.Post; // save
the record changed
MyTIBTransaction.commit;
but, hink, read, see examples.
with TIBQuery, TIBStoreProc, I think is a better way to work with databases.
Alberto Brito
"Matt" <XXXX@XXXXX.COM>escreveu na mensagem
Quote
I'm still learning Dephi's Interbase controls, and can not figure out how to
write back a record.
This test code snippet runs after I have SELECTed a dataset and read a
record
from it. Now I want to write the modified record back to the database.
This test code:
>>
MyTIBTransaction.active:=yes;
MyTIBTransaction.StartTransaction;
MyTIBDataset.edit;

MyTIBDataset.fieldvalues['id']:=id;
MyTIBDataset.FieldValues['movietitle']:=MovieTitle;
MyTIBDataset.fieldvalues['releaseyear']:=ReleaseYear;
MyTIBDataset.fieldvalues['format']:=Format;

MyTIBDataset.post;
MyTIBTransaction.commit;
MyTIBTransaction.active:=no;
<<

generates a "Transaction inactive" error on the second line (odd,
considering the first line of code). I remember from somewhere that I
need
to set the transition.ModifySQL property, but I don't know what to set it
to. I assume I don't have to write a full SQL script to UPDATE each
field,
since that would defeat the purpose of having these controls. All I want
to
do is write back and commit the modified record.
Is this error caused by my not setting .ModifySQL? If so, what do I need
to
set it to? Since it won't run past the second line, is there anything
else
in there that is going to blow up?
Any and all help greatly appreciated,
Thanks,
Matt



 
 

Re: TIBCustomDataSet.ModifySQL?

Ok, Sorry my mistake.
"Jeff Overcash (TeamB)" <XXXX@XXXXX.COM>escreveu na mensagem
Quote


Alberto Brito writes:
>
>I think IBDataset is like a Ttable,

No it is not. It is much more like IBQuery and the component most people
use.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
If there is somebody up there could they throw me down a line. Just a
little helping hand just a little understanding. Just some answers to the
questions that surround me now. If there's somebody up there could
they throw me down a line. (Fish)