Forum Moderators: open

Message Too Old, No Replies

Problem connecting MySQL DB using ASP

connectivity issues

         

Desigol1979

2:29 pm on May 14, 2008 (gmt 0)

10+ Year Member



I have created the following ASP code:

<%
response.ContentType = "text/xml"
strConnection = "driver={MySQL};server=domain.com;uid=user;"
strConnection = strConnection & "pwd=password;database=dbname"

Set conn = Server.CreateObject("ADODB.Connection")
conn.Open strConnection

sql="select * from table"
set rs=conn.Execute(sql)

rs.MoveFirst()

response.write("<?xml version='1.0' encoding='ISO-8859-1'?>")
response.write("<?xml-stylesheet type='text/xsl' href='events.xsl'?>")
response.write("<events>")
while (not rs.EOF)
response.write("<event>")
response.write("<day>" & rs("Day") & "</day>")
response.write("<activity>" & rs("Activity") & "</activity>")
response.write("<time>" & rs("Time") & "</time>")
response.write("<appendix>" & rs("Appendix") & "</appendix>")
response.write("</event>")
rs.MoveNext()
wend

rs.close()
conn.close()
response.write("</events>")
%>

And received the following Error Message:

# Error Type:
ADODB.Connection.1 (0x80004005)
SQLState: S Native Error Code: 2013 [TCX][MyODBC]Lost connection to MySQL server during query
/eventlist.asp, line 7

What seems to be the problem? Is it to do with uploading the MySQL Database in Binary rather than ASCII? Do I have to define a specific db directory to place all MySQL Databases in?