I'm getting this error in my page:
===========================
Microsoft OLE DB Provider for ODBC Drivers error '80040e09'
[TCX][MyODBC]You have an error in your SQL syntax near '' at line 1
/forum/test5.asp, line 38
===========================
I really don't see any reason that there's something incorrect. But I'm also a bit new, so I may be wrong. Here's my file:
===========================
<%
'Get the Topic ID
TopicID = Request.QueryString("topic"
IF Request.QueryString("topic" = "" THEN
TopicID = "1"
ELSE IF Request.QueryString("topic" = "0" THEN
TopicID = "1"
END IF
'Database Connection/Read recordsets
strConnection = "driver={MySQL};server=localhost;uid=mattster;pwd=chair;database=forum"
SET Conn = Server.CreateObject("ADODB.Connection"
Conn.Open strConnection
strMessages = "SELECT * FROM Messages WHERE ForumID = " & TopicID & " AND Original = 0 ORDER BY Date DESC"
SET rsMessages = Conn.Execute(strMessages)
strSettings = "SELECT * FROM Settings"
SET rsSettings = Conn.Execute(strSettings)
%>
<HTML>
<HEAD>
<TITLE><%=rsSettings("SiteName"%></TITLE>
</HEAD>
<BODY bgcolor="#<%=rsSettings("BGColor"%>" text="#<%=rsSettings("TextColor"%>" link="#<%=rsSettings("LinkColor"%>" vlink="#<%=rsSettings("VLinkColor"%>" alink="#<%=rsSettings("ALinkColor"%>">
(Put code for an include file here soon)<br><br><br>
<%
DO UNTIL rsMessages.EOF
%>
<%=rsMessages("Subject"%> - <%=rsMessages("Author"%> (<%=rsMessages("Date"%>/<%=rsMessages("IP"%>)<br>
<%
strReplies = "SELECT messageid, subject, author, date FROM Messages WHERE Original = " & rsMessages("MessageID"
SET rsReplies = Conn.Execute(strReplies)
DO UNTIL rsReplies.EOF
%>
<%=rsMessages("Subject"%> - <%=rsMessages("Author"%> (<%=rsMessages("Date"%>/<%=rsMessages("IP"%>)<br>
<%
rsReplies.MoveNext
LOOP
%>
<%
rsMessages.MoveNext
LOOP
%>
<%
rsMessages.Close
rsSettings.Close
END IF
rsReplies.Close
%>
<br><br><br>(Put code for an include file here soon too)
</body>
</html>
===========================
===========================
Microsoft OLE DB Provider for ODBC Drivers error '80040e09'
[TCX][MyODBC]You have an error in your SQL syntax near '' at line 1
/forum/test5.asp, line 38
===========================
I really don't see any reason that there's something incorrect. But I'm also a bit new, so I may be wrong. Here's my file:
===========================
<%
'Get the Topic ID
TopicID = Request.QueryString("topic"
IF Request.QueryString("topic" = "" THEN
TopicID = "1"
ELSE IF Request.QueryString("topic" = "0" THEN
TopicID = "1"
END IF
'Database Connection/Read recordsets
strConnection = "driver={MySQL};server=localhost;uid=mattster;pwd=chair;database=forum"
SET Conn = Server.CreateObject("ADODB.Connection"
Conn.Open strConnection
strMessages = "SELECT * FROM Messages WHERE ForumID = " & TopicID & " AND Original = 0 ORDER BY Date DESC"
SET rsMessages = Conn.Execute(strMessages)
strSettings = "SELECT * FROM Settings"
SET rsSettings = Conn.Execute(strSettings)
%>
<HTML>
<HEAD>
<TITLE><%=rsSettings("SiteName"%></TITLE>
</HEAD>
<BODY bgcolor="#<%=rsSettings("BGColor"%>" text="#<%=rsSettings("TextColor"%>" link="#<%=rsSettings("LinkColor"%>" vlink="#<%=rsSettings("VLinkColor"%>" alink="#<%=rsSettings("ALinkColor"%>">
(Put code for an include file here soon)<br><br><br>
<%
DO UNTIL rsMessages.EOF
%>
<%=rsMessages("Subject"%> - <%=rsMessages("Author"%> (<%=rsMessages("Date"%>/<%=rsMessages("IP"%>)<br>
<%
strReplies = "SELECT messageid, subject, author, date FROM Messages WHERE Original = " & rsMessages("MessageID"
SET rsReplies = Conn.Execute(strReplies)
DO UNTIL rsReplies.EOF
%>
<%=rsMessages("Subject"%> - <%=rsMessages("Author"%> (<%=rsMessages("Date"%>/<%=rsMessages("IP"%>)<br>
<%
rsReplies.MoveNext
LOOP
%>
<%
rsMessages.MoveNext
LOOP
%>
<%
rsMessages.Close
rsSettings.Close
END IF
rsReplies.Close
%>
<br><br><br>(Put code for an include file here soon too)
</body>
</html>
===========================