ASP tutorial link MySQL Tutorial database tutorial several code
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 for database host name (local host with localhost, remote IP address); database is the name; UID is username; password is 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 a sample statement, please modify
Set objRS = objConn.Execute ("Select FirstName, LastName from Tblusers") and nbsp;
While the not objrs.eof ' While...wend loop for reading all information & nbsp;
Response.Write objrs.fields ("LastName") & "," & Objrs.fields (" FirstName ") &" BR "
objrs.movenext ' recordset pointer Move Down
wend
Objrs.close ' close recordset
Set objRS = nothing ' empty recordset, freeing memory & nbsp;
objconn.close ' close database link
Set objconn = Nothing ' empty database link, free memory
%>
ASP and MySQL connections currently have two methods: one is to use the component, the MYSQLX charge component is commonly used, and the other is to use MYODBC to connect