W
Wayne...
I'm trying to get asp to conect to a MySQL database, I've tried copying a
few examples online that I found [there doesn't seem to be many!!] and I
always get a 500 error with the code below. what am i doing wrong?
any examples of a working connection string anyone could show me would be
fantastic. thanks i advance.
Wayne...
<%@ LANGUAGE="VBSCRIPT" %>
<%
Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.Open = "DSN=main;Uid=wayne;Pwd=******;"
SQL_query = "SELECT * FROM content;"
Set RS = MyConn.Execute(SQL_query)
%>
<HTML>
<HEAD>
<TITLE>test</TITLE>
</HEAD>
<BASEFONT FACE="arial">
<BODY>
<p><b><% Response.Write SQL_query %></b></p>
<%while not RS.eof%>
<%=RS("")%> <%=RS("title")%> <%=RS("date")%> <%=RS("content")
%><br>
<%RS.MoveNext%>
<%wend%>
<%
RS.Close
MyConn.Close
%>
===========
the other version I tried:
===========
<%@ LANGUAGE="VBSCRIPT" %>
<%
strConnection =
"driver={MySQL};server=IP_NUMBER_GOES_HERE;uid=wayne;pwd=******;database=mai
n;option=NUM"
Set adoDataConn = Server.CreateObject("ADODB.Connection")
adoDataConn.Open strConnection
strQuery = "SELECT * FROM content;"
Set RS = adoDataConn.Execute(strQuery)
%>
==================
HEEELLLPPPP!!!!!!!!!!!!!!!!!!!!!!!!!!
few examples online that I found [there doesn't seem to be many!!] and I
always get a 500 error with the code below. what am i doing wrong?
any examples of a working connection string anyone could show me would be
fantastic. thanks i advance.
Wayne...
<%@ LANGUAGE="VBSCRIPT" %>
<%
Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.Open = "DSN=main;Uid=wayne;Pwd=******;"
SQL_query = "SELECT * FROM content;"
Set RS = MyConn.Execute(SQL_query)
%>
<HTML>
<HEAD>
<TITLE>test</TITLE>
</HEAD>
<BASEFONT FACE="arial">
<BODY>
<p><b><% Response.Write SQL_query %></b></p>
<%while not RS.eof%>
<%=RS("")%> <%=RS("title")%> <%=RS("date")%> <%=RS("content")
%><br>
<%RS.MoveNext%>
<%wend%>
<%
RS.Close
MyConn.Close
%>
===========
the other version I tried:
===========
<%@ LANGUAGE="VBSCRIPT" %>
<%
strConnection =
"driver={MySQL};server=IP_NUMBER_GOES_HERE;uid=wayne;pwd=******;database=mai
n;option=NUM"
Set adoDataConn = Server.CreateObject("ADODB.Connection")
adoDataConn.Open strConnection
strQuery = "SELECT * FROM content;"
Set RS = adoDataConn.Execute(strQuery)
%>
==================
HEEELLLPPPP!!!!!!!!!!!!!!!!!!!!!!!!!!