How to use MySQL ODBC driver in VC and Delphi

Source: Internet
Author: User
Tags mysql odbc driver

We often encounter this problem. How can we 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 has high requirements on programmers and must be familiar with a set of mysql api functions.

It's easy. 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

If it is 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

You know.

Open a text editor, such as editplus and notpad, and save the following paragraph as a file with the extension. reg. You can see it. This is a registry file.

Wrong (excluding the following long string of equal signs)

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:WINNTSystem32myodbc.dll" "Setup"="C:WINNTSystem32myodbc.dll" "SQLLevel"="1" "FileUsage"="0" "DriverODBCVer"="02.50" "ConnectFunctions"="YYY" "APILevel"="1" "CpTimeout"="120" [HKEY_LOCAL_MACHINESOFTWAREODBCODBCINST.INIODBC Drivers] "myodbc driver"="installed"

As for why you want to write this, you don't want to ask me, and I don't want to answer it either. This is what Mr. billable has the final say (bill. gates. after saving, double-click the file, which should be named xxx. reg, and then 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.