How to use mysql in vc and delphi? how to use mysql in vc, delphi, vb and other programs? (use of mysql odbc driver) we often encounter such problems, how can I use mysql databases in non-web programs or asp programs? There are two solutions to this problem:
1. use the api function library provided by mysql.
Many well-known mysql client tools are implemented in this way, as is the well-known winmysql tool. This can be implemented in most development tools. For example, vc, bcb, delphi, and vb can be implemented by calling third-party APIs. But it is not easy for everyone to have high requirements on programmers and be familiar with a set of mysql api functions. This method cannot be used in asp or other programs because it does not support com objects.
2. The second is to use the myodbc driver.
You can download the myodbc driver at www.mysql.com, and then follow the steps below to download it.
The first option is to download the full installation package. this package is very large, but it is not appropriate for us to download such a large file, only the file myodbc. dll is useful. Of course, if you have a good dish, I suggest you choose this method. this is easier, but it does not conform to the cfans style, right.
The second method is to directly download the myodbc. dll file, which is only several hundred KB but not easy to use. after a long time of exploration, I found a method to use it.
First, unbind the package and put the myodbc. dll file in the windowssystem or winntsystem32 Directory. it depends on whether your system is win9x or winnt (win2k). you should know.
Open a text editor, such as editplus and notpad, and save the following content as a file with the extension. reg, you see. this is the registry file. do not make a mistake.
If you are using win2k, replace the first line with Windows Registry Editor Version 5.00.
Windows Registry Editor Version 4.00
[HKEY_LOCAL_MACHINESOFTWAREODBCODBCINST.INImyodbc driver]
"UsageCount" = dword: 00000002
"Driver" = "C:/WINNT/System32/myodbc. dll"
"Setup" = "C:/WINNT/System32/myodbc. dll"
"SQLLevel" = "1"
"FileUsage" = "0"
"DriverODBCVer" = "02.50"
"ConnectFunctions" = "YYY"
"APILevel" = "1"
"CpTimeout" = "120"
[HKEY_LOCAL_MACHINESOFTWAREODBCODBCINST.INIODBC Drivers]
"Myodbc driver" = "installed"
After saving the file, double-click the File. it should be xxx. reg, and select OK. OK. Then you open the odbc setup program, create a new data source, and select the myodbc driver. The rest depends on you.