HOW TO CONNECT MYSQL TO BORLAND DELPHI USING MYODBC

HOW TO CONNECT MYSQL TO BORLAND DELPHI USING MYODBC
  1. Creating MySQL ODBC DataSource
  1. We need to install MyODBC (you can download from www.mysql.com)
  2. install MyODBC or MySQLODBC
  3. Create DSN for accesing trough ODBC, follow the step bellow :
  4. Go To Control Panel>>Administrative Tools>>Data Source (ODBC)
  5. When ODBC Data Source Administrator dialogs showed click Add.. button
  6. Create New Data Source dialog will show, choose MySQL ODBC Driver
  7. Click Finish until MySQL ODBC Driver DSN Configuration dialog showed
  8. Enter Data Source Name as you like
  9. fill all information that needed for connection to be occurred
  10. Click Test Data Source Button to testing the connection to MySQL Server
  11. Connection succeed
  12. MySQL ODBC Data Source created
  1. Connecting Data Source to Delphi using ADOConnection
  1. on your project application pick ADOConnection Component in ADO VCL Tab
  2. Put ADOConnection component into a form
  3. Double Click the ADOConnection on your form until Connection String Dialog Wizard appeared
  4. Choose Use Connection String and then click Build Button
  5. when Data link properties dialog box appeared on the provider tab choose Microsoft OLEDB Provider for ODBC Drivers
  6. Click Next Button
  7. On the Connection Tab, fill all the field
  8. Choose Use Data source name and fill thecombobox with MySQL ODBC Data source that we have been created before in DSN
  9. fill information for username, password, and fill the database that you want access in Combobox Enter initial catalog to use
  10. Test the connection with clicking the Test Connection Button
  11. Connection Succed
Download PDF File
Download AVI File

No comments: