This really is old stuff! Relates to delphi 5. and interbase 1.6.
I am attempting to open a DB connection via code. But this code relates to enabling the bond, all of the components were added using delphi drag-drop Interface: DataSource1, TForm1, DBGrid, DBNavigator etc..
procedure TDataModule2.DataModuleCreate(Sender: TObject); begin database.DatabaseName:='C:\MyDatabase.GDB'; database.Connected := true; database.Open; IBTransaction.Active := true; myTable.Open; end;
I've got a TForm with DBGrid and DBNavigator component. I in addition have a TIBQuery (that DataSource1 is connected to) with this particular code around the SQLStrings:
SELECT * FROM NEW_TABLE
Around the Form I've this code make it possible for DBNavigator and DBGrid to exhibit the DB Values. The DB really is easy is simply a table: NEW_TABLE with a brand newWorth of VARCHAR type
procedure TForm1.FormCreate(Sender: TObject); begin DataSource1.DataSet.Open; // This will call the query associated to this DataSource1 the tibQuery1 to call // SELECT * FROM NEW_TABLE, but the message below appears: IBClientError... end;
The content seems: IBClientError with message 'Database not assigned'
OBS1: Basically connect the constituents manually on delphi interface, the bond using the DB is made.