Error with image field
Posted: Thu 15 Mar 2012 22:49
Environment :
Delphi7, UNIDAC 4.1.5 for Delphi 7, SQL Server 2008 R2
Before using UNIDAC, i'm using ADO Connection
sSQL := 'INSERT INTO Customer VALUES ( :pCode, :pPhoto )';
with qryTemp do
begin
close;
SQL.Text := sSQL;
Parameters.ParamByName('pCode').Value := edtCode.Text;
if Image1.Picture.Graphic nil then
Parameters.ParamByName('pPhoto').Assign(Image1.Picture.Graphic)
else
Parameters.ParamByName('pPhoto').Value := NULL;
ExecSQL;
end;
After using UNIDAC,
sSQL := 'INSERT INTO Customer VALUES ( :pCode, :pPhoto )';
with qryTemp do
begin
close;
SQL.Text := sSQL;
ParamByName('pCode').Value := edtCode.Text;
if Image1.Picture.Graphic nil then
ParamByName('pPhoto').Assign(Image1.Picture.Graphic)
else
ParamByName('pPhoto').Value := NULL;
ExecSQL;
end;
Error occur in the statement
ParamByName('pPhoto').Assign(Image1.Picture.Graphic)
what's wrong with my code ?
Thanks for your respond.
Delphi7, UNIDAC 4.1.5 for Delphi 7, SQL Server 2008 R2
Before using UNIDAC, i'm using ADO Connection
sSQL := 'INSERT INTO Customer VALUES ( :pCode, :pPhoto )';
with qryTemp do
begin
close;
SQL.Text := sSQL;
Parameters.ParamByName('pCode').Value := edtCode.Text;
if Image1.Picture.Graphic nil then
Parameters.ParamByName('pPhoto').Assign(Image1.Picture.Graphic)
else
Parameters.ParamByName('pPhoto').Value := NULL;
ExecSQL;
end;
After using UNIDAC,
sSQL := 'INSERT INTO Customer VALUES ( :pCode, :pPhoto )';
with qryTemp do
begin
close;
SQL.Text := sSQL;
ParamByName('pCode').Value := edtCode.Text;
if Image1.Picture.Graphic nil then
ParamByName('pPhoto').Assign(Image1.Picture.Graphic)
else
ParamByName('pPhoto').Value := NULL;
ExecSQL;
end;
Error occur in the statement
ParamByName('pPhoto').Assign(Image1.Picture.Graphic)
what's wrong with my code ?
Thanks for your respond.