strconnection = "dsn=hc188;driver={myodbd driver};server=localhost;uid=root;pwd=;d atabase=hc188"
Set adodataconn = Server.CreateObject ("Adodb.connection")
Adodataconn.open strconnection
' Method two
strconnection= "Dsn=mysql (the best combination of PHP) test;
Driver={mysql (the best combination with PHP) ODBC 3.51 driver};
Server= fill in the server address; uid= username; pwd= password; database=mm ";
' Look at an example
Dim sconnection, objconn, objRS
' Server is the database host name (the local host uses localhost, remote IP address); database is the name; The UID is the username; password is the password
Sconnection = "Driver={mysql ODBC 3.51 DRIVER}; Server=localhost; database=your_mysql_db; Uid=mysql_username; Password=mysql_password; Option=3 "
Set objconn = Server.CreateObject ("ADODB. Connection ")
objConn.Open (sconnection)
' The following SQL statement is an example statement, please modify it according to the actual situation
Set objRS = objConn.Execute ("Select FirstName, LastName from Tblusers")
While the not objrs.eof ' While...wend loop for reading all information
Response.Write Objrs.fields ("LastName") & "," & Objrs.fields ("FirstName") & "BR"
Objrs.movenext ' recordset pointer moves down
Wend
Objrs.close ' Close the recordset
Set objRS = Nothing ' empties the Recordset, freeing up memory
Objconn.close ' Close Database link
Set objconn = Nothing ' empties the database link, freeing up memory
%>
ASP and MySQL connection currently has two ways: one is the use of components, commonly used is the MYSQLX charge component, and the second is to use MYODBC to connect,