var
msMyFile: TMemoryStream;
MaxNo: string;
begin
msMyFile := TMemoryStream.Create;
if FileExists('f:/line.bmp') then
msMyFile.LoadFromFile('f:/line.bmp');
MaxNo := IntToStr(LoginInf.GetTableNextNo('mytable'));
with LoginInf.MySQLPlus do
begin
Close;
SQL.Clear;
SQL.Add('insert into mytable (no) values ('
+ MaxNo + ')');
ExecSQL;
LoginInf.CommitData;
Close;
end;
with LoginInf.MySQLPlus do
begin
Close;
SQL.Clear;
SQL.Add('select mytable.rowid, mytable.myfields from mytable '
+ 'where no = ' + MaxNo);
ShowMessage(SQL.Text);
Open;
Edit;
TBlobField(Fields[0]).LoadFromStream(msMyFile);
LoginInf.CommitData;
Post;
LoginInf.RollBackData;
end;
msMyFile.Free;
end;