'Password=kainushi'
'Server=localhost'
'CharacterSet=utf8'
+ 'Database=kainushi'
'DriverID=MySQL')
Left = 360
Top = 192
'create database if not exists kainushi;'
'use kainushi;'
'create table if not exists images(id int primary key,'
- ' name varchar(10), source mediumblob);')
+ ' name varchar(30), source mediumblob);')
Left = 456
Top = 192
end
- object FDBatchMove1: TFDBatchMove
- Mappings = <>
- LogFileName = 'Data.log'
- Left = 512
- Top = 272
- end
end
LinkPropertyToFieldBitmap: TLinkPropertyToField;
FDQuery1: TFDQuery;
Button2: TButton;
- FDBatchMove1: TFDBatchMove;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
begin
Clear;
Add('drop table images;');
- Add('create table images(id int primary key, name varchar(10), source mediumblob);');
+ Add('create table images(id int primary key, name varchar(30), source mediumblob);');
end;
FormCreate(Sender);
end;
for i := 1 to 50 do
FDTable1.AppendRecord([i, Format('slide%d.jpg', [i]), nil]);
FDTable1.First;
+ FDTable1.CachedUpdates := true;
for i := 1 to 10 do
begin
FDTable1.Edit;
t := TResourceStream.Create(HInstance, Format('Resource_%d', [i]),
RT_RCDATA);
try
- streamToField(t,s);
+ streamToField(t, s);
FDTable1.Post;
finally
s.Free;
end;
FDTable1.Next;
end;
+ FDTable1.ApplyUpdates;
+ FDTable1.CommitUpdates;
+ FDTable1.CachedUpdates := false;
end;
FDTable1.First;
end;
begin
pm.Quality := 100;
bmp := TBitmapSurface.Create;
- img:=TBitmap.Create;
+ img := TBitmap.Create;
try
img.LoadFromStream(stream);
bmp.Assign(img);