Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 A question on the TopSQL function
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 07 September 2003 :  17:35:18  Show Profile  Send ruirib a Yahoo! Message
Due to a problem with a user on SUN One ASP 4.0, I needed to change the TopSQL function. I did it not knowing whether my changes are valid for all circunstances, because I really don't know the purpose of a statement in the function, for the MySQL database.
The statement in question is the one in red:

case "mysql"
	if instr(strSQL,";") > 0 then
	   strSQL1 = Mid(strSQL, 1, Instr(strSQL, ";")-1)
	   strSQL2 = Mid(strSQL, InstrRev(strSQL, ";"))
	   TopSQL = strSQL1 & " LIMIT " & lngRecords & strSQL2
	else
	   TopSQL = strSQL & " LIMIT " & lngRecords
	end if

Since all the calls made to the function are done either with a ";" at the end or without it, why is the statement there? If it is removed, will there be any problem with that (I needed to remove it to have the function working with Sun One ASP 4.0)?

Thanks.


Snitz 3.4 Readme | Like the support? Support Snitz too

Edited by - ruirib on 07 September 2003 17:36:18

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 07 September 2003 :  19:00:05  Show Profile
Good point Rui. I'm not sure why it is there either.

Support Snitz Forums
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 07 September 2003 :  19:10:46  Show Profile
quote:
Originally posted by Davio

Good point Rui. I'm not sure why it is there either.

oh really?

http://forum.snitz.com/forum/topic.asp?TOPIC_ID=20440
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 07 September 2003 :  19:18:42  Show Profile  Send ruirib a Yahoo! Message
Hmmm... I don't have access to that link. And I'm not pretending to have a point, just trying to find out if my fix will work for the user .


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 07 September 2003 :  19:20:54  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
quote:
I don't have access to that link

Same here.
Explanation for those of us who wanna know please

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 07 September 2003 :  19:51:41  Show Profile
quote:
Originally posted by RichardKinser
oh really?

http://forum.snitz.com/forum/topic.asp?TOPIC_ID=20440

LOL.

Ok, I added the code in. I forgot I did.
You can change the code to this if you want:
if instr(strSQL,";") > 0 then
	strSQL1 = Mid(strSQL, 1, Instr(strSQL, ";")-1)
	TopSQL = strSQL1 & " LIMIT " & lngRecords & ";"
else
	TopSQL = strSQL & " LIMIT " & lngRecords
end if
strSQL2 is just adding the ; to the end of the sql query. Or you can remove the ; from the query if that is what is giving the problem. That line of code is not really important to the completion of the function.

Support Snitz Forums
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 07 September 2003 :  20:29:52  Show Profile  Send ruirib a Yahoo! Message
I thought so, but I wanted to be sure. The problem with the user (see this topic) seems to be with an incorrect behavior of the Mid function, in the second call inside TopSQL. It looked like I could avoid that second call but, as I wrote, I wanted to be sure.

Thanks for the info David .


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 07 September 2003 :  22:41:31  Show Profile
No problem Rui.

Support Snitz Forums
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 09 September 2003 :  03:03:56  Show Profile  Visit Gremlin's Homepage
quote:
Ok, I added the code in. I forgot I did.
Don't you hate it when that happens ! lol.

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07