We often encounter such problems, how to use the MySQL database in non-web programs or ASP programs? There are two solutions for this problem:
1. Use the Library of API functions provided by MySQL.
This is how many well-known MySQL client tools are implemented, as is the famous Winmysql tool. This can be achieved in most development tools. such as VC,BCB,DELPHI,VB and so on, as long as can call the third party API can be achieved. But it is not easy for everyone to be familiar with the requirements of the programmer, and to familiarize yourself with the set of MySQL API functions. And this method cannot be used for programs such as ASP, because it does not support COM objects.
2. The second is the use of the MYODBC driver.
You can download the Myodbc driver to www.mysql.com, and then follow it. The first option is to download the full installation package, this package is very large, but for us to be useful only myodbc.dll this file, but to download such a large file, not very appropriate. Of course, if you are very good, I suggest you choose this way, it is easier, but not in line with Cfans style, yes.
The second is to download the Myodbc.dll file directly, only hundreds of K, but not easy to use, I have been groping for a long time to find the way to use it. First you untie the package and place the Myodbc.dll file in the Windows\System or Winnt\System32 directory, depending on whether 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 passage as a file with the extension. Reg, you know, this is a registry file, don't make a mistake (excluding the following long string equals)
If you're using Win2K, replace the first line with
Windows Registry Editor Version 5.00
========================================================== from the downside.
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"
"ConnectFunctions" = "YYY"
"APILevel" = "1"
"CPTimeout" = "120"
[Hkey_local_machine\software\odbc\odbcinst. INI\ODBC Drivers]
"MYODBC Driver" = "Installed"