Author |
Topic |
|
choppermc
New Member
Australia
80 Posts |
Posted - 26 October 2003 : 00:50:11
|
Hi all I need a little help with the My Personalization mod . BTW I'm using MySql
Microsoft VBScript runtime error '800a01a8'
Object required: 'rsPM'
/my.asp, line 330
I managed to fix this error by commenting out rsPM.Close on line 330. But will that cause any problems later?
Also I'm getting this error in the main content area-
MySQL][ODBC 3.51 Driver][mysqld-4.0.14-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'FORUM_TOPICS.T_AUTHOR=1 ORDER BY FORUM_TOPICS.T_LAST_POST DESC'
/my.asp, line 380
If I comment out the line colored red the page shows no errors, but now it seems that all topics from all forums are showing up in my personal page.
strSql = strSql & strTablePrefix & "FORUM.F_SUBJECT, " & strTablePrefix & "TOPICS.T_STATUS, " strSql = strSql & strTablePrefix & "TOPICS.T_VIEW_COUNT, " & strTablePrefix & "TOPICS.FORUM_ID, " strSql = strSql & strTablePrefix & "TOPICS.TOPIC_ID, " & strTablePrefix & "TOPICS.CAT_ID, " strSql = strSql & strTablePrefix & "TOPICS.T_SUBJECT, " strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR, " & strTablePrefix & "TOPICS.T_REPLIES, " strSql = strSql & strMemberTablePrefix & "MEMBERS.M_NAME, " & strTablePrefix & "TOPICS.T_LAST_POST_AUTHOR, " strSql = strSql & strTablePrefix & "TOPICS.T_LAST_POST, " & strMemberTablePrefix & "MEMBERS_1.M_NAME AS LAST_POST_AUTHOR_NAME " strSql = strSql & "FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "FORUM, " strSql = strSql & strTablePrefix & "TOPICS, " & strMemberTablePrefix & "MEMBERS AS " & strMemberTablePrefix & "MEMBERS_1 " strSql = strSql & "WHERE " & strTablePrefix & "TOPICS.T_LAST_POST_AUTHOR = " & strMemberTablePrefix & "MEMBERS_1.MEMBER_ID " strSql = strSql & "AND " & strTablePrefix & "FORUM.FORUM_ID = " & strTablePrefix & "TOPICS.FORUM_ID " strSql = strSql & "AND " & strTablePrefix & "FORUM.CAT_ID = " & strTablePrefix & "TOPICS.CAT_ID " strSql = strSql & "AND " & strMemberTablePrefix & "MEMBERS.MEMBER_ID=" & id strSql = strSql & "AND " & strTablePrefix & "TOPICS.T_AUTHOR=" & id strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_LAST_POST DESC;"
Any help will be Appreciated. Thank You
|
Oh....Is that it? |
Edited by - choppermc on 29 October 2003 06:14:01 |
|
soxc
New Member
53 Posts |
Posted - 26 October 2003 : 02:33:15
|
I think that you need a space to make the SQL valid: strSql = strSql & "AND " & strMemberTablePrefix & "MEMBERS.MEMBER_ID=" & id strSql = strSql & "<insert space here>AND " & strTablePrefix & "TOPICS.T_AUTHOR=" & id strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_LAST_POST DESC;"
If you look the lines above have a space at the end. For this line it is just easier to it at the start.
|
|
|
choppermc
New Member
Australia
80 Posts |
Posted - 26 October 2003 : 04:30:22
|
Thank You Soxc that fixed that error
I have found another problem though, in the Edit page area there are three chocies for "Show Last Topics I have Started" drop down list, they are 5, 10, and ALL I get no errors when I choose ALL, but I get this with 10
[MySQL][ODBC 3.51 Driver][mysqld-4.0.14-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '10 FORUM_FORUM.F_SUBJECT, FORUM_TOPICS.T_STATUS, FORUM_TOPICS.T
/my.asp, line 380
And the same with 5
[MySQL][ODBC 3.51 Driver][mysqld-4.0.14-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '5 FORUM_FORUM.F_SUBJECT, FORUM_TOPICS.T_STATUS, FORUM_TOPICS.T_
/my.asp, line 380
Any one like to tke a shot?
|
Oh....Is that it? |
Edited by - choppermc on 26 October 2003 05:33:56 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 26 October 2003 : 05:55:33
|
probably a space issue again, post the full sql statement for this... |
|
|
|
choppermc
New Member
Australia
80 Posts |
Posted - 26 October 2003 : 06:21:24
|
Here you go dayve-
'## Forum_SQL - Get all active topics from last visit if flag_maxtopics = 0 then strSql = "SELECT " else strSql = "SELECT TOP " & flag_maxtopics & " " end if ' remove this crap
strSql = strSql & strTablePrefix & "FORUM.F_SUBJECT, " & strTablePrefix & "TOPICS.T_STATUS, " strSql = strSql & strTablePrefix & "TOPICS.T_VIEW_COUNT, " & strTablePrefix & "TOPICS.FORUM_ID, " strSql = strSql & strTablePrefix & "TOPICS.TOPIC_ID, " & strTablePrefix & "TOPICS.CAT_ID, " strSql = strSql & strTablePrefix & "TOPICS.T_SUBJECT, " strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR, " & strTablePrefix & "TOPICS.T_REPLIES, " strSql = strSql & strMemberTablePrefix & "MEMBERS.M_NAME, " & strTablePrefix & "TOPICS.T_LAST_POST_AUTHOR, " strSql = strSql & strTablePrefix & "TOPICS.T_LAST_POST, " & strMemberTablePrefix & "MEMBERS_1.M_NAME AS LAST_POST_AUTHOR_NAME " strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "FORUM, " strSql = strSql & strTablePrefix & "TOPICS, " & strMemberTablePrefix & "MEMBERS AS " & strMemberTablePrefix & "MEMBERS_1 " strSql = strSql & "WHERE " & strTablePrefix & "TOPICS.T_LAST_POST_AUTHOR = " & strMemberTablePrefix & "MEMBERS_1.MEMBER_ID " strSql = strSql & "AND " & strTablePrefix & "FORUM.FORUM_ID = " & strTablePrefix & "TOPICS.FORUM_ID " strSql = strSql & "AND " & strTablePrefix & "FORUM.CAT_ID = " & strTablePrefix & "TOPICS.CAT_ID " strSql = strSql & "AND " & strMemberTablePrefix & "MEMBERS.MEMBER_ID=" & id strSql = strSql & " AND " & strTablePrefix & "TOPICS.T_AUTHOR=" & id strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_LAST_POST DESC;"
set rs = my_Conn.Execute (strSql) |
Oh....Is that it? |
Edited by - choppermc on 26 October 2003 06:22:44 |
|
|
soxc
New Member
53 Posts |
Posted - 26 October 2003 : 13:07:37
|
I know where the problem is but I'm not sure what the SQL syntax for MYSQL is with regards to "TOP". The syntax below works with Access.
<snip> '## Forum_SQL - Get all active topics from last visit if flag_maxtopics = 0 then strSql = "SELECT " else strSql = "SELECT TOP " & flag_maxtopics & " "end if </end snip>
Hopefully a MYSQL guy will pop around.
|
|
|
choppermc
New Member
Australia
80 Posts |
Posted - 28 October 2003 : 03:31:18
|
Can "LIMIT" be used instead of "TOP", if so how do I implement it into this statement? Any one. |
Oh....Is that it? |
|
|
choppermc
New Member
Australia
80 Posts |
Posted - 29 October 2003 : 08:27:55
|
Yes!! I fixed the problem. Cheers guys for your help. Here is the code I had to add to my.asp to get this to work. Added Code is in red Deleted Code is in green
'## Forum_SQL - Get all active topics from last visit if strDBType = "mysql" & flag_maxtopics = 0 then strSql = "SELECT " else strSql = "SELECT TOP " & flag_maxtopics & " " end if ' remove this crap
strSql = strSql & strTablePrefix & "FORUM.F_SUBJECT, " & strTablePrefix & "TOPICS.T_STATUS, " strSql = strSql & strTablePrefix & "TOPICS.T_VIEW_COUNT, " & strTablePrefix & "TOPICS.FORUM_ID, " strSql = strSql & strTablePrefix & "TOPICS.TOPIC_ID, " & strTablePrefix & "TOPICS.CAT_ID, " strSql = strSql & strTablePrefix & "TOPICS.T_SUBJECT, " strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR, " & strTablePrefix & "TOPICS.T_REPLIES, " strSql = strSql & strMemberTablePrefix & "MEMBERS.M_NAME, " & strTablePrefix & "TOPICS.T_LAST_POST_AUTHOR, " strSql = strSql & strTablePrefix & "TOPICS.T_LAST_POST, " & strMemberTablePrefix & "MEMBERS_1.M_NAME AS LAST_POST_AUTHOR_NAME " strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS, " & strTablePrefix & "FORUM, " strSql = strSql & strTablePrefix & "TOPICS, " & strMemberTablePrefix & "MEMBERS AS " & strMemberTablePrefix & "MEMBERS_1 " strSql = strSql & "WHERE " & strTablePrefix & "TOPICS.T_LAST_POST_AUTHOR = " & strMemberTablePrefix & "MEMBERS_1.MEMBER_ID " strSql = strSql & "AND " & strTablePrefix & "FORUM.FORUM_ID = " & strTablePrefix & "TOPICS.FORUM_ID " strSql = strSql & "AND " & strTablePrefix & "FORUM.CAT_ID = " & strTablePrefix & "TOPICS.CAT_ID " strSql = strSql & "AND " & strMemberTablePrefix & "MEMBERS.MEMBER_ID=" & id strSql = strSql & " AND " & strTablePrefix & "TOPICS.T_AUTHOR=" & id strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_LAST_POST DESC " if flag_maxtopics = 5 then strSql = strSql & " LIMIT " & flag_maxtopics & ";" else if flag_maxtopics = 10 then strSql = strSql & " LIMIT " & flag_maxtopics & ";" else strSql = strSql & ";" end if end if set rs = my_Conn.Execute (strSql) |
Oh....Is that it? |
Edited by - choppermc on 29 October 2003 08:31:40 |
|
|
soxc
New Member
53 Posts |
Posted - 29 October 2003 : 17:49:49
|
Congrats. |
|
|
acoustika
Junior Member
Denmark
311 Posts |
Posted - 27 November 2003 : 00:20:04
|
Wonderful, made it work for me too ;-)
Thanks choppermc |
May The Code Be With You www.UniqueDk.dk *** The Open Forums of Denmark *** |
|
|
choppermc
New Member
Australia
80 Posts |
Posted - 29 November 2003 : 06:06:35
|
Your welcome acoustika! |
Oh....Is that it? |
|
|
|
Topic |
|
|
|