Thema: Delphi Data Source

Einzelnen Beitrag anzeigen

pronny31

Registriert seit: 8. Okt 2007
97 Beiträge
 
#24

Re: Data Source

  Alt 23. Okt 2007, 08:29
So es hat endlich funktioniert !!

Delphi-Quellcode:
unit mainUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DBCtrls, DB, IBDatabase, IBCustomDataSet, IBQuery,
  IBTable, Grids, DBGrids;

type
  TmainForm = class(TForm)
    IBDatabase1: TIBDatabase;
    IBTransaction1: TIBTransaction;
    IBQuery1: TIBQuery;
    DataSource1: TDataSource;
    DBMemo1: TDBMemo;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  mainForm: TmainForm;

implementation

{$R *.dfm}


procedure TmainForm.FormCreate(Sender: TObject);
var test : String ;
begin
  IBQuery1.sql.Clear;
  IBQuery1.SQL.add('Select Memo1 from pcbeinstellungendefault where zaehler = 10 ');
  IBQuery1.open;
  test := IBQuery1.FieldByName('Memo1').asString;
  DataSource1.DataSet := IBQuery1;
  DBMemo1.DataSource := DataSource1;
  DBMemo1.DataField := 'MEMO1';
end;

end.
  Mit Zitat antworten Zitat