Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delphi + mySQL 4

Status
Not open for further replies.

AP81

Programmer
Apr 11, 2003
740
AU
Hi,

Recently I was asked to write an application in Delphi with a Microsot Access back-end. Halfway through development, my company changed its mind and decided to use mySQL.

My problem is with connecting to the MySQL database with code. I can add a datagrid and select my souce, then display the table statically in a datagrid, but that is not what I want to do. I need to be able to initiate the connection, then add data from recordsets to controls, etc.

The connection must be set up using ODBC and the ODBC 3.51 driver provided by MySQL, so I cannot use any third-party tools to connect to the database (nor BDE).

I am okay for all the coding, just getting the connection string to work.

Any assistance is greatly appreciated.




------------------------------------
There's no place like 127.0.0.1
------------------------------------
 
Worked it out...

Connection_String :=
'Provider=MSDASQL;' +
'DRIVER={MySQL ODBC 3.51 Driver};' +
'SERVER=localhost;' +
'DATABASE=test;' +
'UID=root;' +
'PASSWORD=';




------------------------------------
There's no place like 127.0.0.1
------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top