Author |
Topic |
|
jdura99
Starting Member
USA
12 Posts |
Posted - 07 March 2001 : 17:55:32
|
Hey everyone. When I go to my members page, it is just fine, but then when I try to access the second page or so on it gives me this error....
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error in ORDER BY clause.
/members.asp, line 125
...here is the entire code for the members.asp page....
http://www.joshdura.com/members.txt
Sorry, I didnt want to post it all in this one message so i made the txt file and put it on my site. Please help...I cant add some of the needed moderators without this. Thanks again.
Josh Dura
http://www.joshdura.com http://forum.joshdura.com |
|
davemaxwell
Access 2000 Support Moderator
USA
3020 Posts |
Posted - 07 March 2001 : 18:23:50
|
Nothing jumps out at me, so could you do a favor. Add a response.write strsql right before line 125 which is rs.open strSql, my_Conn, 3 then post what is printed out when you access the second page so we can see the actual sql which is being used....
Dave Maxwell -------------- Proud to be a "World Class" Knucklehead |
|
|
jdura99
Starting Member
USA
12 Posts |
|
jdura99
Starting Member
USA
12 Posts |
Posted - 07 March 2001 : 18:36:36
|
oh...sorry didnt print it...
SELECT FORUM_MEMBERS.MEMBER_ID, FORUM_MEMBERS.M_STATUS, FORUM_MEMBERS.M_NAME, FORUM_MEMBERS.M_LEVEL, FORUM_MEMBERS.M_EMAIL, FORUM_MEMBERS.M_COUNTRY, FORUM_MEMBERS.M_HOMEPAGE, FORUM_MEMBERS.M_ICQ, FORUM_MEMBERS.M_YAHOO, FORUM_MEMBERS.M_AIM, FORUM_MEMBERS.M_TITLE, FORUM_MEMBERS.M_POSTS, FORUM_MEMBERS.M_LASTPOSTDATE, FORUM_MEMBERS.M_LASTHEREDATE, FORUM_MEMBERS.M_DATE FROM FORUM_MEMBERS WHERE FORUM_MEMBERS.M_STATUS = 1 ORDER BY FORUM_MEMBERS.M_POSTS DESC, FORUM_MEMBERS.M_NAME ASC
Thats what it is
Josh Dura
http://www.joshdura.com http://forum.joshdura.com |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 07 March 2001 : 20:06:44
|
Actually, this is the code that we needed to see. The page you are getting the error from:
SELECT FORUM_MEMBERS.MEMBER_ID, FORUM_MEMBERS.M_STATUS, FORUM_MEMBERS.M_NAME, FORUM_MEMBERS.M_LEVEL, FORUM_MEMBERS.M_EMAIL, FORUM_MEMBERS.M_COUNTRY, FORUM_MEMBERS.M_HOMEPAGE, FORUM_MEMBERS.M_ICQ, FORUM_MEMBERS.M_YAHOO, FORUM_MEMBERS.M_AIM, FORUM_MEMBERS.M_TITLE, FORUM_MEMBERS.M_POSTS, FORUM_MEMBERS.M_LASTPOSTDATE, FORUM_MEMBERS.M_LASTHEREDATE, FORUM_MEMBERS.M_DATE FROM FORUM_MEMBERS WHERE FORUM_MEMBERS.M_STATUS = 1 ORDER BY FORUM_MEMBERS.M_POSTS DESC, FORUM_MEMBERS.M_NAME ASC LIMIT 15, 15
I presume you are using MySql. Because you are using MySql, it adds "LIMIT 15, 15" to the sql statement. Can someone who knows the SQL Query langage tell him how to fix that?
And I think this should be considered a bug.
|
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 07 March 2001 : 20:37:08
|
Ok, I figured it out. jdura99, look for this code in the members.asp file:if strDBType = "mysql" then 'MySql specific code if mypage > 1 then OffSet = CInt((mypage - 1) * strPageSize) strSql = strSql & " LIMIT " & OffSet & ", " & strPageSize & " " end if Change it to this:if strDBType = "mysql" then 'MySql specific code if mypage > 1 then OffSet = CInt((mypage - 1) * strPageSize) strSql = strSql & ", LIMIT " & OffSet & ", " & strPageSize & " " end if See if that works.
Edited by - Davio on 07 March 2001 20:38:50 |
|
|
jdura99
Starting Member
USA
12 Posts |
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 07 March 2001 : 21:05:26
|
How is that possible?? Line 125 is inside an if...else statement that will only execute if you are using MySql.
|
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 07 March 2001 : 21:16:23
|
Ok, do this for me jdura. See the same response.write strsql davemaxwell asked you to put in? Change it to this response.write(strSql & "strDBType is:" & strDBType)
And also update the members.txt file with the changes so I can see what's happening.
|
|
|
jdura99
Starting Member
USA
12 Posts |
|
jdura99
Starting Member
USA
12 Posts |
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 07 March 2001 : 22:09:54
|
You're Welcome. Glad you got it working. I dunno how you got the forum working with "mysql" as your strDBType. *shrugs*
|
|
|
davemaxwell
Access 2000 Support Moderator
USA
3020 Posts |
Posted - 07 March 2001 : 22:36:25
|
quote:
You're Welcome. Glad you got it working. I dunno how you got the forum working with "mysql" as your strDBType. *shrugs*
Most of the code in MySql will work fine in Access. The only thing which won't work is the creation of the identity fields which are called different things in the two databases. SQL-wise, they are very similar...
Dave Maxwell -------------- Proud to be a "World Class" Knucklehead |
|
|
|
Topic |
|