Author |
Topic  |
|
rsoxhater
Junior Member
 
120 Posts |
Posted - 20 July 2001 : 10:08:19
|
Anyone have any idea why my search function is only returning 1 result? http://www.topprospectalert.com/snitz
Even if you search for something you know there is more than one of it still returns just 1. I'm using huwrs version.
Thanks, Patrick
|
|
davemaxwell
Access 2000 Support Moderator
    
USA
3020 Posts |
Posted - 20 July 2001 : 12:03:28
|
If you look, you are getting an error on the search (it's in the black box...)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/snitz/Search.asp, line 218 Find the SQL which is being executed in line 218 and see which field is mispelled or not part of your database....
Dave Maxwell -------------- Proud to be a "World Class" Knucklehead |
 |
|
rsoxhater
Junior Member
 
120 Posts |
Posted - 21 July 2001 : 01:25:12
|
This is my line 218 f IsNull(rs("T_LAST_POST_AUTHOR")) then
I checked in the topics table of the db and the T_LAST_POST_AUTHOR is there and spelled exactly the same way.
What else should I look for? Thanks
|
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 21 July 2001 : 01:43:55
|
Is your line 218 missing the i ?
it should be:
if IsNull(rs("T_LAST_POST_AUTHOR")) then |
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 21 July 2001 : 01:50:53
|
You could also check to see if the database field T_LAST_POST_AUTHOR is being called in the SELECT sql statement. I have seen that this is a known issue with Huwr's version of the forums.
- David |
 |
|
rsoxhater
Junior Member
 
120 Posts |
Posted - 21 July 2001 : 08:41:55
|
I checked that, I just copied and pasted wrong.
quote:
Is your line 218 missing the i ?
it should be:
if IsNull(rs("T_LAST_POST_AUTHOR")) then
|
 |
|
rsoxhater
Junior Member
 
120 Posts |
Posted - 21 July 2001 : 08:43:05
|
David, give me a hint as to where I'd check that. I have a limited knowledge of ASP.
Thanks, Patrick
quote:
You could also check to see if the database field T_LAST_POST_AUTHOR is being called in the SELECT sql statement. I have seen that this is a known issue with Huwr's version of the forums.
- David
|
 |
|
rsoxhater
Junior Member
 
120 Posts |
Posted - 21 July 2001 : 08:44:59
|
is this what I should be checking? --------------
Request.QueryString("mode") = "DoIt" then if Request.Form("Search") <> "" or Request.Form("SearchMember") <> 0 then 'Huwr keywords = split(Request.Form("Search"), " ") keycnt = ubound(keywords)
'## Forum_SQL - Find all records with the search criteria in them strSql = "SELECT " & strTablePrefix & "FORUM.FORUM_ID, " & strTablePrefix & "FORUM.F_SUBJECT, " & strTablePrefix & "FORUM.CAT_ID, " & strTablePrefix & "TOPICS.TOPIC_ID, " & strTablePrefix & "TOPICS.T_SUBJECT, " & strTablePrefix & "TOPICS.T_MAIL, " & strTablePrefix & "TOPICS.T_STATUS, " & strTablePrefix & "TOPICS.T_LAST_POST, " & strTablePrefix & "TOPICS.T_REPLIES, "& strTablePrefix & "TOPICS.T_VIEW_COUNT, " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME " strSql = strSql & " FROM ((" & strTablePrefix & "FORUM LEFT JOIN " & strTablePrefix & "TOPICS " strSql = strSql & " ON " & strTablePrefix & "FORUM.FORUM_ID = " & strTablePrefix & "TOPICS.FORUM_ID) LEFT JOIN " & strTablePrefix & "REPLY " strSql = strSql & " ON " & strTablePrefix & "TOPICS.TOPIC_ID = " & strTablePrefix & "REPLY.TOPIC_ID) LEFT JOIN " & strMemberTablePrefix & "MEMBERS " strSql = strSql & " ON " & strTablePrefix & "TOPICS.T_AUTHOR = " & strMemberTablePrefix & "MEMBERS.MEMBER_ID " strSql = strSql & " WHERE (" if Request.Form("Search") <> "" then 'Huwr '################# New Search Code ################################################# if Request.Form("SearchMessage") = 1 then if Request.Form("andor") = "phrase" then strSql = strSql & " (" & strTablePrefix & "FORUM.F_SUBJECT LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%'" strSql = strSql & " OR " & strTablePrefix & "TOPICS.T_SUBJECT LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%') " else For Each word in keywords SearchWord = ChkString(word, "SQLString") strSql = strSql & " (" & strTablePrefix & "FORUM.F_SUBJECT LIKE '%" & SearchWord & "%'" strSql = strSql & " OR " & strTablePrefix & "TOPICS.T_SUBJECT LIKE '%" & SearchWord & "%') " if cnt < keycnt then strSql = strSql & Request.Form("andor") cnt = cnt + 1 next end if else if Request.Form("andor") = "phrase" then strSql = strSql & " (" & strTablePrefix & "REPLY.R_MESSAGE LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%'" strSql = strSql & " OR " & strTablePrefix & "FORUM.F_DESCRIPTION LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%'" strSql = strSql & " OR " & strTablePrefix & "TOPICS.T_SUBJECT LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%'" strSql = strSql & " OR " & strTablePrefix & "TOPICS.T_MESSAGE LIKE '%" & ChkString(Request.Form("Search"), "SQLString") & "%') " else For Each word in keywords SearchWord = ChkString(word, "SQLString") strSql = strSql & " (" & strTablePrefix & "REPLY.R_MESSAGE LIKE '%" & SearchWord & "%'" strSql = strSql & " OR " & strTablePrefix & "FORUM.F_DESCRIPTION LIKE '%" & SearchWord & "%'" strSql = strSql & " OR " & strTablePrefix & "TOPICS.T_SUBJECT LIKE '%" & SearchWord & "%'" strSql = strSql & " OR " & strTablePrefix & "TOPICS.T_MESSAGE LIKE '%" & SearchWord & "%') " if cnt < keycnt then strSql = strSql & Request.Form("andor") cnt = cnt + 1 next end if end if strSql = strSql & " ) " cnt = 0 '################# New Search Code ################################################# if Request.Form("Forum") <> 0 then strSql = strSql & " AND " & strTablePrefix & "FORUM.FORUM_ID = " & Request.Form("Forum") & " " end if if Request.Form("SearchDate") <> 0 then dt = cint(Request.Form("SearchDate")) strSql = strSql & " AND (T_DATE > '" & DateToStr(dateadd("d", -dt, strForumTimeAdjust)) & "')" end if
end if ' Huwr if Request.Form("Search") = "" and Request.Form("SearchMember") <> 0 then 'Huwr strSql = strSql & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & Request.Form("SearchMember") & " " strSql = strSql & " OR " & strTablePrefix & "REPLY.R_AUTHOR = " & Request.Form("SearchMember") & ") " else if Request.Form("SearchMember") <> 0 then strSql = strSql & " AND (" & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & Request.Form("SearchMember") & " " strSql = strSql & " OR " & strTablePrefix & "REPLY.R_AUTHOR = " & Request.Form("SearchMember") & ") " end if end if
strSql = strSql & " AND " & strTablePrefix & "FORUM.F_TYPE = " & 0 strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.FORUM_ID DESC, " strSql = strSql & " " & strTablePrefix & "TOPICS.T_LAST_POST DESC"
mypage = request("whichpage")
If mypage = "" then mypage = 1 end if
rs.Open strSql, my_Conn, 3,1
|
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 21 July 2001 : 10:39:19
|
quote: is this what I should be checking?
Yep, that's exactly it. You would need to include the missing field. Should look something like this:
'## Forum_SQL - Find all records with the search criteria in them strSql = "SELECT " & strTablePrefix & "FORUM.FORUM_ID, " & strTablePrefix & "FORUM.F_SUBJECT, " & strTablePrefix & "FORUM.CAT_ID, " & strTablePrefix & "TOPICS.TOPIC_ID, " & strTablePrefix & "TOPICS.T_SUBJECT, " & strTablePrefix & "TOPICS.T_MAIL, " & strTablePrefix & "TOPICS.T_STATUS, " & strTablePrefix & "TOPICS.T_LAST_POST, " & strTablePrefix & "TOPICS.T_LAST_POST_AUTHOR, " & strTablePrefix & "TOPICS.T_REPLIES, " & strTablePrefix & "TOPICS.T_VIEW_COUNT, " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME "
- David |
 |
|
rsoxhater
Junior Member
 
120 Posts |
Posted - 21 July 2001 : 18:54:01
|
ok, fixed that one error message, now I'm down to line 247, which is : <a href="post.asp?method=EditTopic&TOPIC_ID=<% =rs("TOPIC_ID") %>&FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&auth=<% =rs("T_AUTHOR") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"urlpath") %>&Topic_Title=<% =ChkString(rs("T_SUBJECT"),"urlpath") %>"><img src="icon_pencil.gif" alt="Edit Message" border="0" hspace="0"></a> ======= What should I add to the forum sql now?
|
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 23 July 2001 : 01:09:37
|
I don't know what you're asking. You said you fixed the first error you were getting, are you getting another error?
- David |
 |
|
rsoxhater
Junior Member
 
120 Posts |
Posted - 23 July 2001 : 11:41:32
|
David - Yes I'm getting another error, however its in a different place. You can check it out at www.topprospectalert.com/snitz/
The error is on line 247, and that is my line 247 posted above.
Thanks!
|
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 23 July 2001 : 11:56:03
|
Well, what is the error you got? I don't get any error on your search.asp page when I did a search on it. I think it only happens when your are logged in as admin. So I can't see the error.
- David |
 |
|
rsoxhater
Junior Member
 
120 Posts |
Posted - 24 July 2001 : 20:35:32
|
Yeah, guess it was only showing that error in admin mode, kinda odd, lol. Thanks for all your help guys.
|
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 24 July 2001 : 22:00:41
|
Yep. It only accured when it is showing the Admin Options on the search.asp page. Did you fix the error?
- David |
 |
|
|
Topic  |
|