Seems there is some interest in running MySQL as a backend for
(classic) ASP based sites, at least looking at recent posts on
DevShed forums.
As questions are quite similar and I've not found a good
ASP+MySQL tutorial on the web I'm posting a short example
here
Here is my snippet:
- dim adoConn
- dim adoRS
- set adoConn = Server.CreateObject ( "ADODB.Connection" )
- set adoRS = Server.CreateObject ( "ADODB.Recordset" )
- adoConn.CursorLocation = 3
- 'adUseClient
- adoConn.Open "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=users;UID=root;PWD=; OPTION=16427"
- adoRS.ActiveConnection = adoConn
- if adoConn.errors.count = 0 then
- adoRS.Open "Select ...", adoConn
- .....
- adoRS.Close
- else
- response.write ( "ERROR: Couldn't connect to database" …