Author |
Topic |
acoustika
Junior Member
Denmark
311 Posts |
Posted - 30 November 2003 : 09:09:08
|
Thanks cripto9t, I remember the TopSql Andhave tried working a little with it, bud couldn't seem to find the way to write it, I'll try your way ;-) |
May The Code Be With You www.UniqueDk.dk *** The Open Forums of Denmark *** |
|
|
acoustika
Junior Member
Denmark
311 Posts |
Posted - 30 November 2003 : 09:31:49
|
I got i working with LIMIT, easier than the TopSql I think, that one I couldn't get to work :-)
Nice Script :-) |
May The Code Be With You www.UniqueDk.dk *** The Open Forums of Denmark *** |
|
|
RebelTech
Average Member
USA
613 Posts |
Posted - 01 December 2003 : 08:02:53
|
quote: Originally posted by acoustika
I got i working with LIMIT, easier than the TopSql I think, that one I couldn't get to work :-)
Nice Script :-)
Sorry to take so long to get back to you, I was away from the computer yesterday. I am glad you got it working. I will add cypto's fix to the mod so others won't have to re -invent the wheel. And acoustika I will add your fixvalso if you will post it. |
Edited by - RebelTech on 01 December 2003 08:05:53 |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 01 December 2003 : 11:33:01
|
RebelTech, it would be better if you posted a new topic in the MOD Add-On Forum (W/ Code) for your mod, instead of moving this topic. |
Support Snitz Forums
|
|
|
RebelTech
Average Member
USA
613 Posts |
Posted - 01 December 2003 : 14:27:28
|
quote: Originally posted by Davio
RebelTech, it would be better if you posted a new topic in the MOD Add-On Forum (W/ Code) for your mod, instead of moving this topic.
No problem. Will do. |
|
|
acoustika
Junior Member
Denmark
311 Posts |
Posted - 01 December 2003 : 14:41:29
|
Here is The fix I made for MySql I added the code in RED and removed the code in GREEN
strSql = "SELECT " & intTopicCount & " " strSql = strSql & strTablePrefix & "TOPICS.TOPIC_ID, " strSql = strSql & strTablePrefix & "TOPICS.T_SUBJECT, " strSql = strSql & strTablePrefix & "TOPICS.T_MESSAGE, " strSql = strSql & strTablePrefix & "TOPICS.T_DATE, " strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR, " strSql = strSql & strTablePrefix & "MEMBERS.MEMBER_ID, " strSql = strSql & strTablePrefix & "MEMBERS.M_NAME " strSql = strSql & " FROM ((" & strTablePrefix & "FORUM " strSql = strSql & "INNER JOIN " & strTablePrefix & "TOPICS ON " strSql = strSql & strTablePrefix & "FORUM.FORUM_ID = " strSql = strSql & strTablePrefix & "TOPICS.FORUM_ID) " strSql = strSql & "INNER JOIN " & strTablePrefix & "MEMBERS ON " strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR = " strSql = strSql & strTablePrefix & "MEMBERS.MEMBER_ID) " If ForumID <> "ANY" Then strSql = strSql & " WHERE " & strTablePrefix & "TOPICS.FORUM_ID = " & ForumID strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_DATE DESC " strSql = strSql & "LIMIT " & intTopicCount |
May The Code Be With You www.UniqueDk.dk *** The Open Forums of Denmark *** |
|
|
RebelTech
Average Member
USA
613 Posts |
Posted - 01 December 2003 : 22:12:27
|
Thanks acoustika I updated the readme with your fix and gave you credit for it thanks. |
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 02 December 2003 : 01:47:42
|
Just beware that the code above now won't work with MS SQL or MS Access heh. |
Kiwihosting.Net - The Forum Hosting Specialists
|
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 02 December 2003 : 01:49:53
|
If strDBType = "mysql" then
strSql = "SELECT "
Else
strSql = "SELECT TOP " & intTopicCount & " "
End If
strSql = strSql & strTablePrefix & "TOPICS.TOPIC_ID, "
strSql = strSql & strTablePrefix & "TOPICS.T_SUBJECT, "
strSql = strSql & strTablePrefix & "TOPICS.T_MESSAGE, "
strSql = strSql & strTablePrefix & "TOPICS.T_DATE, "
strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR, "
strSql = strSql & strTablePrefix & "MEMBERS.MEMBER_ID, "
strSql = strSql & strTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & " FROM ((" & strTablePrefix & "FORUM "
strSql = strSql & "INNER JOIN " & strTablePrefix & "TOPICS ON "
strSql = strSql & strTablePrefix & "FORUM.FORUM_ID = "
strSql = strSql & strTablePrefix & "TOPICS.FORUM_ID) "
strSql = strSql & "INNER JOIN " & strTablePrefix & "MEMBERS ON "
strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR = "
strSql = strSql & strTablePrefix & "MEMBERS.MEMBER_ID) "
If ForumID <> "ANY" Then strSql = strSql & " WHERE " & strTablePrefix & "TOPICS.FORUM_ID = " & ForumID
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_DATE DESC "
If strDBType = "mysql" then
strSql = strql & "LIMIT " & intTopicCount
End If
|
Kiwihosting.Net - The Forum Hosting Specialists
|
|
|
RebelTech
Average Member
USA
613 Posts |
Posted - 02 December 2003 : 02:00:44
|
Thanks Gremlin, zip updated. Is it ok for MS SQL? |
|
|
Gremlin
General Help Moderator
New Zealand
7528 Posts |
Posted - 02 December 2003 : 03:53:07
|
Yeah should work for all of them now I think, haven't tested mysql but access definately still works which means MSSQL should too :) |
Kiwihosting.Net - The Forum Hosting Specialists
|
|
|
tribaliztic
Senior Member
Sweden
1532 Posts |
Posted - 02 December 2003 : 11:11:52
|
Hmm... I've read this thread and can't find the answer, I get this error: ADODB.Connection.1 error '80004005'
SQLState: 42000 Native Error Code: 1064 [TCX][MyODBC]You have an error in your SQL syntax near 'LIMIT 5' at line 1
/forum/simple_slash.asp, line 46
the line is: Set objRS = objConn.Execute(strSQL)
I run Serverhackers forum, on MySQL database.
|
/Tribaliztic - www.gotlandrace.se -
|
|
|
RebelTech
Average Member
USA
613 Posts |
Posted - 02 December 2003 : 12:22:10
|
quote: Originally posted by tribaliztic
Hmm... I've read this thread and can't find the answer, I get this error: ADODB.Connection.1 error '80004005'
SQLState: 42000 Native Error Code: 1064 [TCX][MyODBC]You have an error in your SQL syntax near 'LIMIT 5' at line 1
/forum/simple_slash.asp, line 46
the line is: Set objRS = objConn.Execute(strSQL)
I run Serverhackers forum, on MySQL database.
Download the latest .zip from ftp://ftp.spinbusters.com/simpleslash.zip and see if that don't fix it. |
|
|
tribaliztic
Senior Member
Sweden
1532 Posts |
Posted - 03 December 2003 : 03:01:43
|
I did that yesterday, is there a new one released since? I'll try that now anyways... |
/Tribaliztic - www.gotlandrace.se -
|
|
|
RebelTech
Average Member
USA
613 Posts |
Posted - 03 December 2003 : 03:53:06
|
The opening section of code was replaced with this:
If strDBType = "mysql" then
strSql = "SELECT "
Else
strSql = "SELECT TOP " & intTopicCount & " "
End If
strSql = strSql & strTablePrefix & "TOPICS.TOPIC_ID, "
strSql = strSql & strTablePrefix & "TOPICS.T_SUBJECT, "
strSql = strSql & strTablePrefix & "TOPICS.T_MESSAGE, "
strSql = strSql & strTablePrefix & "TOPICS.T_DATE, "
strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR, "
strSql = strSql & strTablePrefix & "MEMBERS.MEMBER_ID, "
strSql = strSql & strTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & " FROM ((" & strTablePrefix & "FORUM "
strSql = strSql & "INNER JOIN " & strTablePrefix & "TOPICS ON "
strSql = strSql & strTablePrefix & "FORUM.FORUM_ID = "
strSql = strSql & strTablePrefix & "TOPICS.FORUM_ID) "
strSql = strSql & "INNER JOIN " & strTablePrefix & "MEMBERS ON "
strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR = "
strSql = strSql & strTablePrefix & "MEMBERS.MEMBER_ID) "
If ForumID <> "ANY" Then strSql = strSql & " WHERE " & strTablePrefix & "TOPICS.FORUM_ID = " & ForumID
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_DATE DESC "
If strDBType = "mysql" then
strSql = strql & "LIMIT " & intTopicCount
End If
If yours looks like that and still does not work try replacing the above with this:
strSql = "SELECT " & intTopicCount & " "
strSql = strSql & strTablePrefix & "TOPICS.TOPIC_ID, "
strSql = strSql & strTablePrefix & "TOPICS.T_SUBJECT, "
strSql = strSql & strTablePrefix & "TOPICS.T_MESSAGE, "
strSql = strSql & strTablePrefix & "TOPICS.T_DATE, "
strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR, "
strSql = strSql & strTablePrefix & "MEMBERS.MEMBER_ID, "
strSql = strSql & strTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & " FROM ((" & strTablePrefix & "FORUM "
strSql = strSql & "INNER JOIN " & strTablePrefix & "TOPICS ON "
strSql = strSql & strTablePrefix & "FORUM.FORUM_ID = "
strSql = strSql & strTablePrefix & "TOPICS.FORUM_ID) "
strSql = strSql & "INNER JOIN " & strTablePrefix & "MEMBERS ON "
strSql = strSql & strTablePrefix & "TOPICS.T_AUTHOR = "
strSql = strSql & strTablePrefix & "MEMBERS.MEMBER_ID) "
If ForumID <> "ANY" Then strSql = strSql & " WHERE " & strTablePrefix & "TOPICS.FORUM_ID = " & ForumID
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_DATE DESC "
strSql = strSql & "LIMIT " & intTopicCount |
|
|
Topic |
|