Einzelnen Beitrag anzeigen

Natcree

Registriert seit: 5. Mär 2013
502 Beiträge
 
Delphi 7 Enterprise
 
#1

Bitmap in mysql Datenbank

  Alt 27. Nov 2014, 17:26
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='vornethen begin
  clientdataset1.Fieldbyname('personalausweisvorne').Assign(Image);
  Cancel := True;//Only want one image
  end;
  if label27.Caption='hintenthen begin
  clientdataset1.fieldbyname('personalausweishinten').Assign(Image);
  Cancel := True;//Only want one image
  end;
end;

Geändert von Natcree (27. Nov 2014 um 17:29 Uhr)
  Mit Zitat antworten Zitat