Forums

ASP

This topic is locked

ASP Recordset Error Message

Posted 15 Jan 2007 19:28:49
1
has voted
15 Jan 2007 19:28:49 Joseph Mathieu posted:
I am getting the following error message when I execute my asp page:

Microsoft OLE DB Provider for SQL Server (0x80040E14)
Incorrect syntax near '11'.
/expertcs/Forum/index.asp, line 27

This error is referencing my new recordset, here is the code:


<%
Dim rsPost__MMColParam
rsPost__MMColParam = "1"
If (Request("MM_EmptyValue" <> "" Then
rsPost__MMColParam = Request("MM_EmptyValue"
End If
%>
<%
Dim rsPost__MMColParam2
rsPost__MMColParam2 = "1/14/2007"
If (Now() - 7 <> "" Then
rsPost__MMColParam2 = Now() - 7
End If
%>
<%
Dim rsPost
Dim rsPost_numRows

Set rsPost = Server.CreateObject("ADODB.Recordset"
rsPost.ActiveConnection = MM_connExpertCS_STRING
rsPost.Source = "SELECT intPostID, txtPostTitle, dtePostDate, intPostBy, intCatID, memPostContent, txtNickName FROM dbo.tbl_Blog, dbo.tbl_Users WHERE bitPostShow = " + Replace(rsPost__MMColParam, "'", "''" + " AND dbo.tbl_Blog.intPostBy = dbo.tbl_Users.intUserID AND dtePostDate > " + Replace(rsPost__MMColParam2, "'", "''" + " ORDER BY dtePostDate DESC"
rsPost.CursorType = 0
rsPost.CursorLocation = 2
rsPost.LockType = 1
rsPost.Open() <font color=red>&lt;-- "This is the line 27 that the error message is refering too"</font id=red>

rsPost_numRows = 0
%&gt;

Can anyone tell me why I am getting an error for my rsPost function?
<font color=black></font id=black>

Reply to this topic