How to properly obtain the ADO connection string for mysql,access and use that connection string to connect to the database

Source: Internet
Author: User

How to correctly get the ADO connection string for MySQL, excerpt from the Web http://blog.csdn.net/zyq5945/article/details/5486393

First, you correctly installed the MySQL database driver (mysql-connector-odbc-5.1.6-win32.msi)

1. Create a new empty text file on the desktop mysql.txt, rename it to Mysql.udl;

2. Double-click the Mysql.udl file to open the Database Connection Properties dialog box, select Micrsoft Ole DB Provider for ODBC Drivers on the Providers page, and click Next.

3. On the "Connections" page, "Specify Data Source" Select "Use connection string";

4. Click "Compile", pop "select Data Source", click "New" in the "File Data Source" page, select the MySQL driver "MySQL ODBC 5.1 Driver" When creating a new data source.

5. Click "Next", click "Browse", in the "Save as" dialog box file name to write "MySQL", click "Next", click "Done";

6. On demand (for example) in the MySQL connnettor/odbc Data Source Configuration dialog box;

7. Click "Test" to see if the connection is successful, the connection will have a "connenction successful" prompt box, need more detailed settings click "Details", click "OK", set to complete;

8. Return to the "Database Connection Properties" dialog, click "Test Connection", the successful word is the connection string we want.

Here is the connection string for the native test:

Driver=mysql ODBC 5.2 ANSI Driver; Server=localhost; Uid=root; pwd=123;database=my_db; port=3306

Note: After you close the "Database connection Properties" and double-click mysql.udl to open the dialog box, because the password is missing, click "Test Connection" will not connect, the "Database Connection Properties" dialog box to complete the password, etc., the text to open the Mysql.udl file is the full connection string.

To use this string for the program code that LabVIEW connects to the database, the program tests the form that connects to the database and reads the data.

Use Notepad to open the contents of the UDL file just as

It is also possible to use the string for connecting to the database, which is the test code

You can still connect to the database after you enter it.

The operation for an Access database is simpler than this. After the UDL file is built, select the drive that the arrow refers to

After the UDL is generated, the string is used for the connection string.

How to properly obtain the ADO connection string for mysql,access and use that connection string to connect to the database

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.