February 6th, 2017, 04:29 AM
MYSQL ACCESS through DELPHI
I have been using myODBC to connect to mysql database for ages. I want to bypass the SETUP of myodbc and connect directly to the database.
A typical setup for my program is setup as follows.
1) Install the DELPHI enviroment
2) Install MYODBC
3) Install my PROGRAM
4) Setup 4 ODBC connectings in windows (i have 4 databases for my program).
So ideally what i would like is to remove point 4 from the equation? I googled and i just cannot get an answer.
In my program i setup my ODBC connection like this (i only show one i have 4 of those)
db1 is a database component. I know this code is very primitive. But it has been working for years. Its time for a change.
db1.DatabaseName := 'myodbc_db1';
db1.AliasName := 'myodbc_db1';
db1.Connected := true;
February 7th, 2017, 06:02 PM
Which version of Delphi are you using, and are you developing only for Windows?
If your application is strictly for windows, then I suggest you download the free ZEOS database components.
Depending on which version of Delphi you have you can either download the latest version from: https://sourceforge.net/projects/zeoslib/
and if an older Delphi not supported by that version, then download version 6.6 here: https://sourceforge.net/projects/zeo...-6.6.6-stable/
With ZEOS, you don't rely on ODBC, but do need the MySQL DLL (filename: libmysql.dll) that you can get from here: https://dev.mysql.com/downloads/connector/c/
in the zip file it is located in the \lib\ directory, if you download the installer, not sure where it puts the dll, but you'd need to find it and make sure the dll is placed the your and any target computer either in the same directory as the application or on the path somewhere.
ZEOS also has support via a forum here: Zeoslib Portal - Index page
February 7th, 2017, 11:41 PM
Originally Posted by rojam
I could ve used firedac as well probably. My only problem with these components is that i need to replace all my current queries with those components.
With roughly 600 plus forms it will take me ages. But if there is no other solution i guess we need to do it. Thanks for your help. I'll definitely look into ZeosLib.