How to connect to an ODBC Database

Abstract: Basic steps to get connected to any database with ODBC connectivity

Below are basic steps to get Delphi for PHP to connect to an ODBC Database

  1. in Control Panel, run the ODBC Data Source Administator, create a DSN to your database and test that it works. If you are unfamiliar with this step, contact the vendor of your ODBC driver.
  2. Create a database component in Delphi for PHP. Set the DriverName property of the database component to odbc.
  3. Set the Host property of the database component to the DSN name you created in step 1.
  4. If your DSN did not have a UserName or UserPassword, set those properties of the Database component as well.
  5. Connect components to use your database, such as Table or Query, a datasource and a grid.
  6. Set the Connected property of your database to true and the Active property of your Table or Query to True.