How to use mysql in vc and delphi (the use of mysql odbc driver)
znsoft July 30, 2000
Email it to me and I will talk about my views Previous articleNext article
How to use mysql in vc, delphi, vb and other programs (use of mysql odbc driver)
We often encounter this problem, how to use it in non-web programs or asp programs What about mysql database? There are two solutions to this problem:
1. Use the api function library provided by mysql.
Many famous mysql client tools are implemented in this way, including the famous winmysql tool. This can be achieved in most development tools.
For example, vc, bcb, delphi, vb, etc., as long as the third-party API can be called, it can be realized. However, the requirements for programmers are very high, and they must be familiar with a set of MySQL API functions. This is not an easy task for everyone. And this method cannot be used for programs such as ASP because it does not support COM objects.
2. The second is to use the myodbc driver.
You can go to www.mysql.com to download the myodbc driver, and then just follow the steps below.
The first option is to download the full installation package. This package is large, but it is useful for us. There is only the file myodbc.dll, but it is not appropriate to download such a large file. Of course, if you
are good at it, I suggest you choose this method. It’s easier, but it’s not in line with cfans’ style, right?
The second method is to download the myodbc.dll file directly. It only has a few hundred kilobytes, but it is not easy to use. It took me a long time to find a way to use it.
First unpack the package and put the myodbc.dll file into the windowssystem or winntsystem32 directory, depending on whether your system is win9x or winnt (win2k), you should
know it.
Then open a plain text editor, such as editplus, notpad, etc. (depending on your preference) save the following paragraph as a file with the extension .reg. You know, this is a registry file. Don’t make the
mistake (excluding the long series of equal signs below)
If you are using win2k, please replace the first line with