Hallo beim einfügen eines Bildes in ein
Mysql Datenbank zeigt er mir diesen Fehler
---------------------------
Auftragsmanager
---------------------------
Cannot assign a TBitmap to a TWideStringField.
---------------------------
OK
---------------------------
Hier mein Quellcode
Delphi-Quellcode:
procedure TForm1.DoDestroy;
begin
Twain.Free;//Don't forget to free Twain!
inherited;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
label27.Caption:='vorne';
//Create Twain
if Twain = nil then begin
Twain := TDelphiTwain.Create;
Twain.OnTwainAcquire := TwainTwainAcquire;
end;
//Load Twain Library dynamically
if Twain.LoadLibrary then
begin
//Load source manager
Twain.SourceManagerLoaded := TRUE;
//Allow user to select source -> only the first time
if not Assigned(Twain.SelectedSource) then
Twain.SelectSource;
if Assigned(Twain.SelectedSource) then begin
//Load source, select transference method and enable (display interface)}
Twain.SelectedSource.Loaded := TRUE;
Twain.SelectedSource.ShowUI := TRUE;//display interface
Twain.SelectedSource.Enabled := True;
end;
end else begin
ShowMessage('Twain is not installed.');
end;
end;
procedure TForm1.TwainTwainAcquire(Sender: TObject; const Index: Integer;
Image: TBitmap; var Cancel: Boolean);
begin
if label27.Caption='vorne' then begin
clientdataset1.Fieldbyname('personalausweisvorne').Assign(Image);
Cancel := True;//Only want one image
end;
if label27.Caption='hinten' then begin
clientdataset1.fieldbyname('personalausweishinten').Assign(Image);
Cancel := True;//Only want one image
end;
end;