Thanks for the reply healdem, I had a few problems with it but I eventually got it, only needed to make minor changes to the code. I'm really jumping in at the deep end here because I know very little about asp, sql, and databases, so I'm learning as I go.
I tried around 7 different odbc connections, this is the one that worked (just in case someone else is trying to do it)
Code:
<% @LANGUAGE = VBScript %>
<% Option Explicit %>
<%
Dim sConnection, objConn , objRS
'sConnection = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;PORT=3306;DATABASE=DB NAME; USER=USER ID;PASSWORD=USER PASSWORD;OPTION=3;");
sConnection = "Driver={MySQL ODBC 3.51 Driver};" & _
"Server=mysql.hosting365.ie;" & _
"Database=DB NAME;" & _
"Uid=USER ID;" & _
"Pwd=USER PASSWORD;"
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
%>
I really got stuck on the ODBC connection, I kept on putting the address of my server in
Code:
'sConnection = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=mysql.hosting365.ie;PORT=3306;DATABASE=DB NAME; USER=USER ID;PASSWORD=USER PASSWORD;OPTION=3;");
but apparently thats how you do it if your accessing a database remotely,
since my database was on the same server as my site SERVER=localhost; is the correct one.
I would like someone else to confirm this, I'm very new mysql and odbc so I could be wrong