MySQL ODBC interface is implemented by installing the MyODBC driver, which is cross-platform. For Linux and other Unix operating systems, install the third-party ODBC standard support platform, such as Iodbc. Simple ASP Sample Code: dimsql, mysqlsetsqlserver. createobject (adodb. connection) mysqldr
MySQL ODBC interface is implemented by installing the MyODBC driver, which is cross-platform. For Linux and other Unix operating systems, install the third-party ODBC standard support platform, such as Iodbc. Simple ASP Sample Code: dim SQL, mysql set SQL = server. createobject ("adodb. connection") mysql = "dr
MySQL ODBC interface is implemented by installing the MyODBC driver, which is cross-platform. For Linux and other Unix operating systems, install the third-party ODBC standard support platform, such as Iodbc.
Simple ASP Sample Code:
<% Dim SQL, mysql Set SQL = server. createobject ("adodb. connection ") Mysql = "driver = {mysql odbc 3.51 driver}; database = database; Server = host; uid = user; password = Password; "'option = settings SQL. open mysql %> |
The above Code uses the MyODBC development version 3.51 connection example. The development version is used because some new features and stability are not available in the 2.x official version. A few days ago I read an article on how to write a security program written by Microsoft security experts. As mentioned above, if the code of the ASP file is hacked, the database may not be guaranteed, and a series of problems may occur, or even the management permission may be obtained. As mentioned in the article, the solution is to compile com components and then connect to the database by ASP calling the component method. The advantage of doing so is to improve security, but the problem is that there are only a few people capable of doing so. My compromise is to define the data source. The database, user, password, and set connection information are all defined in the data source, which greatly simplifies implementation and enhances security. Of course, to ensure that the data source can be accessed in the actual operating environment, it must be defined as a "system data source ", I think it is harmless to define it as "User Data Source" or "System Data Source" during development.
<% Dim SQL Set SQL = server. createobject ("adodb. connection ") SQL. open "dns = MySQL Data Source Name" %> |
[Related articles]
- High-end or low-end, why is MySQL initiating an open-source stream?
- Google releases improved MySQL code
- How to access the MySQL database in. NET