954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

connecting to database error

i m very new to asp. i m trying to learn asp. i m trying to connect to mysql database.
i m using this code
<%
' Open database
Dim Conn, RS
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={MySql}; Server=localhost; database=db name; uid=name; pwd=pass; option=0;"
Set RS = Conn.Execute("SELECT * From userss")
' display results
While Not RS.EOF
Response.Write RS.Fields("usercode") & "
"
RS.MoveNext
Wend
' closing connection
RS.Close
Conn.Close
Set RS = Nothing
Set Conn = Nothing
%>

but i m getting the error as


Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/myweb/a.asp, line 5


i have apache on port 80 on my pc
thats y i m working asp on iis
as localhost:81/myweb/a.asp
is this causing any problem

aarya
Junior Poster
139 posts since Sep 2005
Reputation Points: 11
Solved Threads: 0
 

the error was i had no myodbc connection. i downloaded myodbc connector the it worked.

aarya
Junior Poster
139 posts since Sep 2005
Reputation Points: 11
Solved Threads: 0
 

also use option 3. aparently it makes a difference

william_stam
Junior Poster
131 posts since Mar 2005
Reputation Points: 10
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You