Subject | Re: [IBO] Suggestions please |
---|---|
Author | Daniel Bertin |
Post date | 2002-03-07T21:47:08Z |
Let me re-phrase my email, sorry for the babling,
Is this the correct way to insert a record using IBO components?
IB_DSQL1.SQL:
INSERT INTO AXLES (AXPOS, IDVEH, PICTURE)
VALUES (:PAXPOS, :PIDVEH, :PPICTURE)
with DataM.IB_DSQL1 do
begin
ParamByName('PAXPOS').asinteger := EDAxPos.Value;
ParamByName('PIDVEH').asinteger := DataM.VehiclesIDVEH.AsInteger;
ParamByName('PPICTURE').Assign(JfDbFocusImage1.Picture.Bitmap);
try
execute;
except
Raise;
end;
DataM.Axles.Refresh;
all data checks are done in the form, and no need to roll back.
Daniel
At 10:52 AM 06/03/2002 -0800, you wrote:
Is this the correct way to insert a record using IBO components?
IB_DSQL1.SQL:
INSERT INTO AXLES (AXPOS, IDVEH, PICTURE)
VALUES (:PAXPOS, :PIDVEH, :PPICTURE)
with DataM.IB_DSQL1 do
begin
ParamByName('PAXPOS').asinteger := EDAxPos.Value;
ParamByName('PIDVEH').asinteger := DataM.VehiclesIDVEH.AsInteger;
ParamByName('PPICTURE').Assign(JfDbFocusImage1.Picture.Bitmap);
try
execute;
except
Raise;
end;
DataM.Axles.Refresh;
all data checks are done in the form, and no need to roll back.
Daniel
At 10:52 AM 06/03/2002 -0800, you wrote:
>Hi all,[Non-text portions of this message have been removed]
>In my quest to learn this properly, I would appreciate suggestions, on the
>proper way to write a record to the database. Using TField way of thinking
>I would do this;
>
>DataM.Axles.Insert;
>DataM.AxlesIDVEH.AsInteger := DataM.VehiclesIDVEH.AsInteger;
>DataM.AxlesAXPOS.AsVariant := EDAxPos.AsValue;
>DataM.AxlesAXSTEER.AsInteger := Steer.AsValue;
>DataM.AxlesPICTURE.Assign(JfDbFocusImage1.Picture.Bitmap);
>DataM.AxlesPOSLO_T.AsString := '********';
>DataM.AxlesPOSLI_T.AsString := '********';
>DataM.AxlesPOSRO_T.AsString := '********';
>DataM.AxlesPOSRI_T.AsString := '********';
>DataM.Axles.Post;
>
>I know this is not the correct approach, so I tried using this, from an
>example IBO program.
>but cannot insert the picture(BMP) into the table. Is my approach wrong ?
>should I use DSQL component? or the SQL property of the IBOQuery?
>
>DataM.Axles.ExecuteImmediate( 'INSERT INTO AXLES ( AXPOS, IDVEH ) ' +
> 'VALUES ( ' + inttostr(EDAxPos.Value) + ' , ' +
> inttostr(DataM.VehiclesIDVEH.AsInteger) + ',' +
> DataM.ImagesIMGBMP.BlobType + ') ', nil );
>DataM.Axles.Refresh;
>
>Can Someone give suggestions to a Newbie?
>thanks
>Daniel