Author |
Topic  |
|
animedj
Junior Member
 
USA
190 Posts |
|
Lord Maverick
New Member

Norway
92 Posts |
Posted - 09 August 2000 : 16:06:03
|
Tested it, and it returned this error message:
Microsoft JET Database Engine error '80040e07'
Data type mismatch in criteria expression.
/Forum2000/topic_nav.asp, line 19
|
 |
|
Nathan L
New Member

USA
83 Posts |
Posted - 09 August 2000 : 16:08:48
|
OK, the first two SQL statements need to be changed so that T_LAST_POST_DATE is a text string (i.e. placing it inside 's). As of right now, it's not so it's not being recognized as a text string, causing the date type mismatch.
Response.Write ("The Reign of Nice") |
 |
|
Lord Maverick
New Member

Norway
92 Posts |
Posted - 09 August 2000 : 16:27:18
|
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>OK, the first two SQL statements need to be changed so that T_LAST_POST_DATE is a text string (i.e. placing it inside 's). As of right now, it's not so it's not being recognized as a text string, causing the date type mismatch.<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Cant find the T_LAST_POST<font color=red>_DATE</font id=red>, so it would be nice to see the actual coding...
|
 |
|
animedj
Junior Member
 
USA
190 Posts |
Posted - 09 August 2000 : 16:46:59
|
hmm that's starnge.. I didn't get the error.. anyways I update the zip with fix. Anyways try to replace the SQL queries with these lines. The only fix added it's the <b>'</b> around the T_LAST_POST field
strSQL = "SELECT TOP 1 T_SUBJECT, TOPIC_ID " & _ "FROM " & strTablePrefix & "TOPICS " & _ "WHERE T_LAST_POST > '" & T_LAST_POST & _ "' AND FORUM_ID=" & Request.QueryString("Forum_ID") & _ " ORDER BY T_LAST_POST DESC;" set rsPrevTopic = my_conn.Execute (strSQL) strSQL = "SELECT TOP 1 T_SUBJECT, TOPIC_ID " & _ "FROM " & strTablePrefix & "TOPICS " & _ "WHERE T_LAST_POST < '" & T_LAST_POST & _ "' AND FORUM_ID=" & Request.QueryString("Forum_ID") & _ " ORDER BY T_LAST_POST DESC;" set rsNextTopic = my_conn.Execute (strSQL)
|
 |
|
slemieux
Junior Member
 
USA
234 Posts |
Posted - 09 August 2000 : 16:56:56
|
Yahoo!!
That seems to have fixed it! Thanks animedj!! That one's been driving me nuts <img src=icon_smile.gif border=0 align=middle>
|
 |
|
Nathan L
New Member

USA
83 Posts |
Posted - 09 August 2000 : 17:24:33
|
Whoops, yeah, it's just T_LAST_POST. Anyway....
Response.Write ("The Reign of Nice") |
 |
|
Lord Maverick
New Member

Norway
92 Posts |
Posted - 09 August 2000 : 17:45:48
|
There is a logical mistake here, and I'm confused about the texting "next newest topic" and "next oldest topic". I think a more understandable solutions to the users would be to do the last/next thing according to how its visualised on the forum.asp.
I also prefer to use "next topic" (meaning next topic as it is visualised at forum.asp) and "last topic".
First the logical thing. The sorting order in animedjs latest SQL should be <font color=red>ASC</font id=red> not DESC for the first SQL-test. Else it would return to the newest post (at the top of forum.asp) when clicking "next oldest topic" at the oldest topic. (Think my tongue just twirled...!!) I've changed the SQL animedj last posted to this:
strSQL = "SELECT TOP 1 T_SUBJECT, TOPIC_ID " & _ "FROM " & strTablePrefix & "TOPICS " & _ "WHERE T_LAST_POST > '" & T_LAST_POST & _ "' AND FORUM_ID=" & Request.QueryString("Forum_ID") & _ " ORDER BY T_LAST_POST <font color=red>ASC</font id=red>;"
set rsPrevTopic = my_conn.Execute (strSQL)
strSQL = "SELECT TOP 1 T_SUBJECT, TOPIC_ID " & _ "FROM " & strTablePrefix & "TOPICS " & _ "WHERE T_LAST_POST < '" & T_LAST_POST & _ "' AND FORUM_ID=" & Request.QueryString("Forum_ID") & _ " ORDER BY T_LAST_POST DESC;"
set rsNextTopic = my_conn.Execute (strSQL)
and I've also changed the following code to this:
if rsPrevTopic.EOF then prevTopic = "<font color=red>last topic</font id=red>" else prevTopic = "<a href=topic.asp?cat_id=" & request.queryString("CAT_ID") & _ "&FORUM_ID=" & Request.QueryString("FORUM_ID") & _ "&TOPIC_ID=" & rsPrevTopic("TOPIC_ID") & _ "&Topic_Title=" & ChkString(rsPrevTopic("T_SUBJECT"),"urlpath") & _ "&Forum_Title=" & ChkString(Request.QueryString("Forum_Title"),"urlpath") & _ "><font color=red>last topic</font id=red></a>" end if if rsNextTopic.EOF then NextTopic = "<font color=red>next topic"</font id=red> else NextTopic = "<a href=topic.asp?cat_id=" & request.queryString("CAT_ID") & _ "&FORUM_ID=" & Request.QueryString("FORUM_ID") & _ "&TOPIC_ID=" & rsNextTopic("TOPIC_ID") & _ "&Topic_Title=" & ChkString(rsNextTopic("T_SUBJECT"),"urlpath") & _ "&Forum_Title=" & ChkString(Request.QueryString("Forum_Title"),"urlpath") & _ "><font color=red>next topic</font id=red></a>" end if
Edited by - Lord Maverick on 09 August 2000 17:46:54
Edited by - Lord Maverick on 09 August 2000 17:48:20 |
 |
|
animedj
Junior Member
 
USA
190 Posts |
Posted - 09 August 2000 : 20:25:36
|
About the queries, you are right Maverick, That's something I've overlooked while i was coding it this morning, and about the wroding, well that's a people choice...for me last post would mean the laspot being posted.. <img src=icon_smile_big.gif border=0 align=middle> . Fixed the zip and well.. you already posted the query.
|
 |
|
|
Topic  |
|