...

View Full Version : asp mysql connection error



mazer
03-26-2006, 06: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
%>

mazer
03-26-2006, 06:20 PM
Just figured it out, Uppercase mistake on table name!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum