Access MySQL Guide with ODBC Interface

zhaozj2021-02-16  56

Access MySQL Guide with ODBC Interface

Current Author: Wang Meng (HeartIcy@163.com) Creation Date: January 15, 2003 Revision: 1.1

MySQL is good and bad, I want to want to think I have always thought that this is not a programmer or system designer should be more important. If there is a rights selection, a programmer or a system designer should do to choose the most economical and most suitable solution for the project. MySQL is just one of many solutions, it shouldn't be more important.

MySQL's ODBC interface implementation is driven by installing myodbc, this driver is a cross-platform. If you are used under the Unix system operating system such as Linux, you need to install these third-party ODBC standard support platforms.

Simple ASP Sample Code:

<% DIM SQL, MySQLSET SQL = Server.createObject ("AdoDb.Connection") mysql = "driver = {mysql =" DRIVER}; Database = library; server = host; uid = user; password = password; "Option = Set SQL.Open MySQL%>

This code is an example of using the MyodBC development version 3.51, using the development version because some new features and stability 2.x official version do not have. A few days ago, I saw the tutorial of how to write a security program written by Microsoft Security experts. The upper side refers to the way the ASP file is seen in accordance with the method of the above example, then the database may not guarantee, then a series of questions, even being managed. In the article, the method is mentioned in the way, and the database is connected by writing a COM component and then incorporated by an ASP call. The advantage of this is to improve safety, but the problem is that people who have been doing so are a few. Then my compromise is to define the data source. All libraries, users, passwords, and setting these connection information are defined in the data source, from a large extent, and the implementation of the implementation is large, and it also enhances the role of security. Of course, in order to ensure that the data source can be accessed in the actual operation environment, it must be defined as "system data source", and when the development is defined as "user data source" or "system data source" I feel that there is no harm.

Use the data source ASP sample code

<% DIM SQLSET SQL = Server.createObject ("AdoDb.Connection" SQL.Open "DNS = mysql Data Source Name"%>

Originally, I would like to talk about some specific details of the configuration parameters, but I saw myodbc's reference manual short and clear, so I won't go to the ax. If you have any questions about this article, you can contact me through email - hearticy@163.com. I hope I can get more friends.

I will take a jade, I hope this guide is useful to you.

** This document Follow the US Free Software Foundation General Document License Agreement Released **

转载请注明原文地址:https://www.9cbs.com/read-24578.html

New Post(0)