I can't get my database connection to work!
According to my host; the mySQL database is local to the machine running the webhost.
Here's what I've tried so far; just a simple connection test.
Code:
<%@ Page Language="VB" aspcompat="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Connection Test</title>
</head>
<body>
<%
Dim conn, rs As Object
conn = Server.CreateObject("ADODB.Connection")
conn.Open("Driver={mySQL ODBC 3.51 Driver}; Server=localhost; Port=3306; Database=websitedb; Uid=website; Pwd=xxxx;")
rs = Server.CreateObject("ADODB.Recordset")
rs.Open("SELECT 1", conn)
Do Until rs.EOF
Response.Write(rs.Fields(0).Value)
Loop
rs.Close()
conn.Close()
rs = Nothing
conn = Nothing
%>
</body>
</html>
Which throws this error
Code:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
On the line highlighted
And I'm afraid I'm stumped as to what to try from here! My gut reaction was that my hosts don't have the mySQL driver installed; but that
surely can't be right, considering that I'm using their mySQL db!
Any ideas are truly welcome
