How to use MySQL in VC, Delphi, VB and other programs (use of MySQL ODBC drivers)
We often encounter such problems, how do we use the MySQL database in a non-Web program or ASP program? There are two solutions for this issue:
1. Use the API library provided by MySQL.
Many famous MySQL client tools are true, and the famous Winmysql tool is like this. This can be implemented in most developments.
For example, VC, BCB, Delphi, VB, etc., as long as the API that can call a third party can be implemented. But the requirements for programmers are very high, and they are familiar with a set of mysql's API function set, which is not for everyone.
Very easy task. And this method cannot be used for ASP and other programs because it does not support COM objects.
2. The second is to use the MyodBC driver.
You can download myodbc drivers at www.mysql.com, and then do it below.
The first choice is to download a fully installed package, this package is very large, but for us, only myodbc.dll files are useful, but download such a big file, not suitable. Of course, if you
Very dish, I suggest you choose this way, it is easy, but it doesn't conform to the style of CFANs.
The second is to download myodbc.dll files directly, only a few hundred k, but it is not easy to use, I have figured it out for a long time to find the method of using it.
First of all, you will be packed, put the myodbc.dll file in Windows / System or WinNT / System32 directory, depending on your system is Win9X or WinNT (win2k), you should
Know.
Then open a plain text editor, such as editplus, notpad, (depending on your preference) Save the following to a file, the extension is .reg, know, this is a registry file, don't engage
Wrong (not including a long string equal sign)
If you use Win2K, please change the first line.
Windows Registry Editor Version 5.00
============================================================================================================================================================================================================= ======== From the downlink
Windows Registry Editor Version 4.00
[HKEY_LOCAL_MACHINE / SOFTWARE / ODBC / ODBCINST.INI / Myodbc Driver] "UsageCount" = dword: 00000002 "driver" = "c: //winnt//system32//myodbc.dll" "setup" = "C: // Winnt //System32//myodbc.dll "" SQLLEVEL "=" 1 "" fileusage "=" 0 "" driverodbcver "=" 02.50 "" connection "=" yyy "" apilevel "=" 1 "" "cptimeout" = "120 "[HKEY_LOCAL_MACHINE / SOFTWARE / ODBC / ODBCINST.INI / ODBC Drivers]" Myodbc Driver "=" Installed "