T O P I C R E V I E W |
ILLHILL |
Posted - 18 March 2006 : 20:28:58 Im trying to add an RSS link to my members personal pages, displaying their latest blogs/updates in rss. I wrote a script and named it PageRSS.asp and have it linked like: http://my.illhill.com/PageRSS.asp?id=XXXX
Here's the error I get:
Microsoft JET Database Engine error '80040e14' Syntax error (missing operator) in query expression 'M.M_MEMBER_ID = & ppMember_ID'. /my/PageRSS.asp, line 30
Here's the code:
<rss version="2.0"> <!-- This web page is a data file that is meant to be read by RSS readers. To read these posts in an user-friendly layout visit http://my.illhill.com --> <channel> <title>Blogs/Updates RSS Feed Sorted By Member</title> <description>Blogs/Updates RSS Feed Sorted By Member</description> <link>http://my.illhill.com</link> <!--#INCLUDE FILE="config.asp" --> <!--#INCLUDE FILE="inc_func_common.asp" --> <!--#INCLUDE FILE="inc_func_secure.asp" --> <% set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString
dim intResults,Topic_ID,strSubject,Topic_Replies,Topic_Last_Post_Reply_ID,Forum_Subject,LastReplyMsg 'disable images strIcons = "0" strIMGInPosts = "0" if Request.QueryString("id") <> "" and IsNumeric(Request.QueryString("id")) = true then ppMember_ID = cLng(Request.QueryString("id")) else ppMember_ID = 0 end if strSql = "SELECT TOP 5 T.TOPIC_ID, T.T_SUBJECT, M.M_NAME, M.MEMBER_ID, T.T_DATE, T.T_SUBJECT, T.T_MESSAGE, T.T_AUTHOR, T.FORUM_ID " strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS M, " & strTablePrefix & "TOPICS T" strSql = strSql & " WHERE M.M_MEMBER_ID = & ppMember_ID " strSql = strSql & " ORDER BY T.TOPIC_ID DESC" set rs = my_Conn.Execute(strSql) if currTopic <> rs("TOPIC_ID") then currTopic = 0 TopicCount = 0 do until rs.EOF or (TopicCount = 5) if currTopic <> rs("TOPIC_ID") then Response.Write "<item>" & vbNewline Response.Write "<title>" & rs("T_SUBJECT") & "</title>" & vbNewline Response.Write "<description>" & rs("T_MESSAGE") & "</description>" & vbNewline Response.Write "<link>http://www.illhill.com/" & rs("M_NAME") & "#" & rs("TOPIC_ID") & "</link>" & vbNewline Response.Write "</item>" & vbNewline TopicCount = TopicCount + 1 end if rs.MoveNext loop end if rs.close set rs = nothing %> </channel> </rss>
Any suggestions on what I'm doing wrong?
Thanks, Dominic < |
6 L A T E S T R E P L I E S (Newest First) |
ILLHILL |
Posted - 06 April 2006 : 18:28:33 Check this: http://forum.snitz.com/forum/topic.asp?TOPIC_ID=61417
I got it to work, using some other code and it works. Hope you like it.
Greets, D< |
fumatul |
Posted - 05 April 2006 : 09:04:10 i got the same error, and still i can't fix it ... nervermid, i'm probably doing something wrong!
PS-Nu uitati! http://www.fumat.caini.org dauneaza grav sanatatii!< |
ILLHILL |
Posted - 28 March 2006 : 18:13:28 Hi Anon, sorry forgot to thank you. I found a way to solve the situation and posted the whole thing as a mini mod in the mod w code forum.
Greets & thanks, Dominic< |
AnonJr |
Posted - 18 March 2006 : 22:46:30 Its in the WHERE clause. Off the cuff it should probably be more like:
Member_ID = cLng(Request.QueryString("MEMBER_ID")) strSql = "SELECT TOP 5 T.TOPIC_ID, T.T_SUBJECT, T.T_DATE, T.T_SUBJECT, T.T_MESSAGE, T.T_AUTHOR, T.FORUM_ID, M.M_NAME, M.MEMBER_ID " strSql = strSql & " FROM " & strTablePrefix & "TOPICS T, " & strMemberTablePrefix & "MEMBERS M" strSql = strSql & " WHERE M.MEMBER_ID = T.T_AUTHOR AND T.T_AUTHOR = " & Member_ID & " " strSql = strSql & " ORDER BY T.TOPIC_ID DESC"
The part in red should also make sure that the author is the member ID you are passing.
Like I said at the beginning, this is near the end of the day for me and is off-the-cuff, so treat accordingly ... make a backup first. < |
ILLHILL |
Posted - 18 March 2006 : 22:22:54 Thanks for the reply. The ppMember part was the error.
Now the strings look like:
Member_ID = cLng(Request.QueryString("MEMBER_ID")) strSql = "SELECT TOP 5 T.TOPIC_ID, T.T_SUBJECT, T.T_DATE, T.T_SUBJECT, T.T_MESSAGE, T.T_AUTHOR, T.FORUM_ID, M.M_NAME, M.MEMBER_ID " strSql = strSql & " FROM " & strTablePrefix & "TOPICS T, " & strMemberTablePrefix & "MEMBERS M" strSql = strSql & " WHERE M.MEMBER_ID = T.T_AUTHOR " strSql = strSql & " ORDER BY T.TOPIC_ID DESC"
However that is only displaying the latest 5 topics by any member and not by the selected member.
:(< |
bobby131313 |
Posted - 18 March 2006 : 20:49:13 quote: set rs = my_Conn.Execute(strSql)
Mine all have a space in them before (strSql) like this...
set rs = my_Conn.Execute (strSql)
That appears to be line 30 if you don't count the blank line.
Could that be the problem?
Edited: Just noticed there is one line that wraps, so I think that is line 30.< |
|
|