mazer
03-26-2006, 05:06 PM
Hi Everyone
I'm trying to connect to mysql from an asp page and I get the following error
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[MySQL][ODBC 3.51 Driver]Access denied for user: 'user_id@%' to database 'db_name'
/html/odbc_test2.asp, line 18
if anyone can help me understand what is causing this error I would greatly appreciate it as I have gone over it again and again and I just don't know what is causing this, my user id and password are correct.
The asp code is:
<% @LANGUAGE = VBScript %>
<% Option Explicit %>
<%
Dim sConnection, objConn , objRS
'sConnection = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=*******;PORT=3306;DATABASE=********; USER=********;PASSWORD=********;OPTION=3;");
sConnection = "Driver={MySQL ODBC 3.51 Driver};" & _
"Server=***********;" & _
"Database=*******;" & _
"Uid=********;" & _
"Pwd=*******;"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open(sConnection)
Set objRS = objConn.Execute("SELECT ProductName, Grade FROM Comics")
While Not objRS.EOF
Response.Write objRS.Fields("ProductName") & ", " & objRS.Fields("Grade") & "<br>"
'Response.Write & " "
objRS.MoveNext
Wend
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
I'm trying to connect to mysql from an asp page and I get the following error
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[MySQL][ODBC 3.51 Driver]Access denied for user: 'user_id@%' to database 'db_name'
/html/odbc_test2.asp, line 18
if anyone can help me understand what is causing this error I would greatly appreciate it as I have gone over it again and again and I just don't know what is causing this, my user id and password are correct.
The asp code is:
<% @LANGUAGE = VBScript %>
<% Option Explicit %>
<%
Dim sConnection, objConn , objRS
'sConnection = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=*******;PORT=3306;DATABASE=********; USER=********;PASSWORD=********;OPTION=3;");
sConnection = "Driver={MySQL ODBC 3.51 Driver};" & _
"Server=***********;" & _
"Database=*******;" & _
"Uid=********;" & _
"Pwd=*******;"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open(sConnection)
Set objRS = objConn.Execute("SELECT ProductName, Grade FROM Comics")
While Not objRS.EOF
Response.Write objRS.Fields("ProductName") & ", " & objRS.Fields("Grade") & "<br>"
'Response.Write & " "
objRS.MoveNext
Wend
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>