Subject | Re: How to get data into a table |
---|---|
Author | Marco Menardi |
Post date | 2002-10-29T21:56:24Z |
You use IBO like you would have used VCL without using persistent fields! When I used standard VCL, I never used persistent fields ;)
I think that first of all, you are using the wrong method for retrieving FIELDS:
your code
qryBooks.ParamByName('BuyDate')...
is for PARAMETERS, while for fields you have to use
qryBooks.FieldByName('BuyDate')...
To add a new record, simply do something like this (not tested, wrote directly here):
with qryBooks do
begin
Insert;
FieldByName('NAME').AsString := 'THE ANCIENT TALE';
FieldByName('BuyDate').AsDate := frmBooklist.dtpBuyDatum.Date;
Post;
end;
But you have to understand Transaction concepts to really be sure about what you are doing. There are some Tech Sheets on IBObject site, and an 'online' FAQ.
And I never use DTP, IB_Date works really well ;)
best regards
Marco Menardi
I think that first of all, you are using the wrong method for retrieving FIELDS:
your code
qryBooks.ParamByName('BuyDate')...
is for PARAMETERS, while for fields you have to use
qryBooks.FieldByName('BuyDate')...
To add a new record, simply do something like this (not tested, wrote directly here):
with qryBooks do
begin
Insert;
FieldByName('NAME').AsString := 'THE ANCIENT TALE';
FieldByName('BuyDate').AsDate := frmBooklist.dtpBuyDatum.Date;
Post;
end;
But you have to understand Transaction concepts to really be sure about what you are doing. There are some Tech Sheets on IBObject site, and an 'online' FAQ.
And I never use DTP, IB_Date works really well ;)
best regards
Marco Menardi
--- In IBObjects@y..., "Florian Hector" <FHector@w...> wrote:
> Hello all,
>
>
> I just started using IBO and am still struggling with some of its
> functionalities:
>
> How do I get data which is not entered through a data sensitive control into
> a table (IB_Query). As long as there were persistent fields I could do
> something like "dsBooksBuyDate.Value := dtpBuyDate.Date", where dsBooks is a
> IBX dataset, BuyDate a field and dtpBuyDate just a simple DateTimePicker.
> With IBO, there doesn't seem to be persistent fields.
>
> I put this in the AfterInsert event of IB_Query:
> "qryBooks.ParamByName('BuyDate').asString :=
> DateToStr(frmBooklist.dtpBuyDatum.Date)", all I ever get is a message saying
> "Fieldname: BuyDate cannot be found".
>
> I managed to get it to work using the IB_Date but not as comfortable as when
> using DTP so I'd be grateful to know how it can be done.
>
> Florian