Subject | Re: [IBO] How to login to Interbase using TIB_Database |
---|---|
Author | Dmitry Beloshistov |
Post date | 2002-08-20T07:12:14Z |
Hello, Scott!
You wrote to <ibobjects@yahoogroups.com> on Tue, 20 Aug 2002 00:57:06 -0500:
SS> Now, I try to actually run the application, and what I get is the
SS> form with a grid with a single cell in it and NO data. No errors,
SS> no complaints, just no data. Other than setting the properties in
SS> the designer, I have not written one line of code (which is sort of
SS> futile if you don't know WHERE to write it...
SS> What have I done wrong?
Sample connection and data show example:
Procedure TForm1.ShowData;
begin
//- set links between components
IB_Query1.IB_Transaction:=IB_Transaction1;
IB_Transaction1.IB_Connection:=IB_Database1;
IB_Query1.IB_Connection:=IB_Database1;
IB_DataSource1.DataSet:= IB_Query1;
IB_Grid1.DataSource:= IB_DataSource1;
//- connection and data show
IB_Database1.LoginPrompt:=True; // show login prompt before connect
IB_Database1.Connect; // connect to server
if IB_Database1.Connected then
begin
IB_Query1.SQL.Text:='SELECT * FROM MyTable';
IB_Transaction1.StartTransaction;
IB_Query1.Open; // open data
end
else ShowMessage('No IB connection present');
end;
Procedure TForm1.CloseData;
begin
IB_Query1.Close;
if IB_Transaction1.InTransaction then
begin
IB_Transaction1.Commit;
IB_Transaction1.Close;
end;
IB_Database1.Disconnect;
end;
WBR, Dmitry Beloshistov AKA [-=BDS=-]
e-mail: torin@...
You wrote to <ibobjects@yahoogroups.com> on Tue, 20 Aug 2002 00:57:06 -0500:
SS> Now, I try to actually run the application, and what I get is the
SS> form with a grid with a single cell in it and NO data. No errors,
SS> no complaints, just no data. Other than setting the properties in
SS> the designer, I have not written one line of code (which is sort of
SS> futile if you don't know WHERE to write it...
SS> What have I done wrong?
Sample connection and data show example:
Procedure TForm1.ShowData;
begin
//- set links between components
IB_Query1.IB_Transaction:=IB_Transaction1;
IB_Transaction1.IB_Connection:=IB_Database1;
IB_Query1.IB_Connection:=IB_Database1;
IB_DataSource1.DataSet:= IB_Query1;
IB_Grid1.DataSource:= IB_DataSource1;
//- connection and data show
IB_Database1.LoginPrompt:=True; // show login prompt before connect
IB_Database1.Connect; // connect to server
if IB_Database1.Connected then
begin
IB_Query1.SQL.Text:='SELECT * FROM MyTable';
IB_Transaction1.StartTransaction;
IB_Query1.Open; // open data
end
else ShowMessage('No IB connection present');
end;
Procedure TForm1.CloseData;
begin
IB_Query1.Close;
if IB_Transaction1.InTransaction then
begin
IB_Transaction1.Commit;
IB_Transaction1.Close;
end;
IB_Database1.Disconnect;
end;
WBR, Dmitry Beloshistov AKA [-=BDS=-]
e-mail: torin@...