ASP - MYSQL connection error randomly appears

498 Views Asked by At

I have built a website using asp classic on my own hosted win2k server using iis5 for my asp file and MySQL 5.6.11 which is hosted on a separate win7 home premium machine. When accessing the website which I am hosting I receive a random connection error:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'data.mydomain.com' (10060)

myasppage.asp, line 12

data.domain.com points to my data server (the win7 box).

where line 12 on that page is:

rslogin.Open "SELECT * FROM admin WHERE username = '"& usern &"'", strProvider, , , adCmdTable

my entire connection code is:

<%strProvider="DRIVER={MySQL ODBC 3.51 Driver}; SERVER=data.mydomain.com; PORT=3306;  DATABASE=mydatabase; USER=myusername; PASSWORD=xxxxx; OPTION=0;"%>

<%
dim rslogin
set rslogin=Server.CreateObject( "ADODB.Recordset" )
usern = session("usern")
rslogin.Open "SELECT * FROM admin WHERE username = '"& usern &"'", strProvider, , , adCmdTable%>

This error pops up randomly. Some times the site works and other times I get this error. When I do get this error, if I hit refresh, the site usually works. I've racked my brain and search on many forums and Google and can't find a solution. The only information I have found is if this error occurs 100% of the time.

Anyone have any suggestions or thoughts?

0

There are 0 best solutions below