Memposting Image (JPEG) Kedalam Field
ADOConnection.BeginTrans;
try
with ADOQuery do
begin
Close;
SQL.Clear;
SQL.Add('INSERT INTO Pic_file ');
SQL.Add('(pic_id ,');
SQL.Add(' pic_image )');
SQL.Add('VALUES ');
SQL.Add('('+#39+txtCode.Text+#39+',');
SQL.Add(' '+':pic_image'+')');
if Photo.Picture.Graphic <> nil then
Parameters.ParamByName('pic_image').Assign(Photo.Picture.Graphic)
else Parameters.ParamByName('pic_image').Value :=NULL;
ExecSQL;
end;
ADOConnection.CommitTrans;
Screen.Cursor :=crDefault;
except
on E:Exception do
begin
ShowMessage(E.Message);
ADOConnection.RollbackTrans;
end;
end;
Pada script diatas, field pic_image adalah field dengan tipe BLOB***
0 comments:
Posting Komentar
Jika sobat merasa informasi ini bermanfaat, silahkan sobat memberikan komentar. Jika sobat hendak men-COPY ARTIKEL INI, MOHON KIRANYA MENCANTUMKAN SUMBERNYA, MARI KITA SALING MENGHARGAI HAK KEKAYAAN INTELEKTUAL. Jangan lupa, klik Google+ diside bar sebelah kiri
Click to see the code!
To insert emoticon you must added at least one space before the code.