Page 1 of 1

trouble in parambyname

Posted: 20.03.2010, 23:56
by fajar-khairil
hi all i new to zeos,and i got problem when using this code:

Code: Select all

 with dm.QAct do
    begin
    close;
    sql.Clear;
    sql.Text:='insert into PEMINJAMAN(TRANSID,FAKTUR,IDBUKU,IDMEMBER,TGLPINJAM,TGLKEMBALI,IDPETUGAS,JUMLAH) values(:transid,:faktur:idbuku,:idmember,:tglpinjam,:tglkembali,:idpetugas,:jumlah)';
    parambyname('transid').asstring:=transid;
    Parambyname('faktur').asstring:=flatedit1.Text;
    ParamByName('idbuku').asstring:=advstringgrid1.Cells[0,i];
    ParamByName('idmember').asstring:=flatedit2.text;
    ParamByName('tglpinjam').asdate:=strtodate(flatedit4.text);
    ParamByName('tglkembali').asdate:=strtodate(flatedit5.Text);
    ParamByName('idpetugas').asstring:=idptgs;
params.ParamByName('jumlah').asinteger:=strtoint(advstringgrid1.Cells[2,i]);
    execSQL;
    end;
  end;
the following code return Error:
Image

where my wrong code?i use firebird for database.

Posted: 21.03.2010, 00:32
by IllusionPerdu
In your code :
sql.Text:='insert into PEMINJAMAN(TRANSID,FAKTUR,IDBUKU,IDMEMBER,TGLPINJAM,TGLKEMBALI,IDPETUGAS,JUMLAH) values(:transid,:faktur:idbuku,:idmember,:tglpinjam,:tglkembali,:idpetugas,:jumlah)';
you forget the "," near ":faktur:idbuku"