Author |
Topic |
|
rsoxhater
Junior Member
120 Posts |
Posted - 30 May 2003 : 01:47:50
|
This just started happening with our polls - everything was installed and working fine before - check out the error here:
http://www.traderretreat.com/community/topic.asp?TOPIC_ID=33758
Any ideas what would cause this / how to fix it?
THanks guys! |
Edited by - rsoxhater on 30 May 2003 01:48:03 |
|
Rasco
Advanced Member
Germany
3192 Posts |
Posted - 30 May 2003 : 03:25:04
|
Which error? Can`t see one. |
German Snitz Forum
|
Edited by - Rasco on 30 May 2003 03:26:01 |
|
|
rsoxhater
Junior Member
120 Posts |
Posted - 30 May 2003 : 14:35:08
|
It only happens when your logged in - try viewing it logged in as the following accoutn: guest / pass: trguest |
|
|
rsoxhater
Junior Member
120 Posts |
Posted - 30 May 2003 : 14:36:49
|
You can vote fine when not logged in, but you get an error when logged in. Really odd, I've never seen this happen before... |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 30 May 2003 : 14:45:06
|
I still don't see or get any error when I voted using that guest account. |
Support Snitz Forums
|
|
|
rsoxhater
Junior Member
120 Posts |
Posted - 30 May 2003 : 16:58:46
|
This is the error members get:
Microsoft VBScript runtime error '800a0006'
Overflow: 'cint'
/community/inc_func_common.asp, line 62
|
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 30 May 2003 : 23:51:20
|
And can you post the code that is on line 62 in the inc_func_common.asp file? And also include at least 10 lines of code before line 62. |
Support Snitz Forums
|
|
|
rsoxhater
Junior Member
120 Posts |
Posted - 17 June 2003 : 22:14:02
|
Sorry for my delay here guys:
the code around 62:
'############################################## '## Poll Mod ## '##############################################
function GetVote(pTopic_id) Dim tmpVoted
if strWhoVotes = "members" or (strWhoVotes <> "members" and mLev > 0) then '## Forum SQL - See if user has voted in this poll strSql = "SELECT TOPIC_ID " &_ "FROM " & strTablePrefix & "POLL_VOTES " &_ "WHERE MEMBER_ID = " & MemberID
set rsPoll2 = Server.CreateObject("ADODB.Recordset") rsPoll2.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText
if rsPoll2.EOF or rsPoll2.BOF then tmpVoted = false else do until rsPoll2.EOF or rsPoll2.BOF ----> LINE 62 if cint(pTopic_id) = cint(rsPoll2("TOPIC_ID")) then tmpVoted = true exit do else tmpVoted = false end if rsPoll2.MoveNext loop end if
rsPoll2.close set rsPoll2 = nothing end if |
|
|
rsoxhater
Junior Member
120 Posts |
Posted - 17 June 2003 : 22:15:36
|
I also haven't changed anything in the code anytime around the tiem this has started happening. Anything you can do Davio or anyone else is greatly appreciated - polls are a big part of our forums.
Thanks |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 18 June 2003 : 11:28:27
|
You will have to do some testing to see why the CInt function is erroring out. Do this, right near the same code you posted add the code in red:do until rsPoll2.EOF or rsPoll2.BOF
Response.Write "ID:" & pTopic_id & "<br>ID2:" & rsPoll2("TOPIC_ID") & "<br>"
Response.End
if cint(pTopic_id) = cint(rsPoll2("TOPIC_ID")) then
tmpVoted = true
exit do
else Then try reproducing the error again. You should see some text on the page. Just copy and paste the text in your next post. |
Support Snitz Forums
|
|
|
rsoxhater
Junior Member
120 Posts |
Posted - 18 June 2003 : 19:25:31
|
Davio - thanks for help - heres what it says:
ID:37274 ID2:32677
|
|
|
rsoxhater
Junior Member
120 Posts |
Posted - 18 June 2003 : 19:55:37
|
Also, if this helps, the header and everything shows up fine on the page, just where the message should be it gives that error.
thanks again davio! |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 19 June 2003 : 07:48:39
|
Ok, don't know why I didn't think of that before. Your topic ID's have moved out of scope of an Integer. Integer can only hold somewhere to 32,000 or -32,000. Since your id is 37,000 cint throws an error. You will need to change the CInt to CLng (change both of them on that line). This will convert it to a Long variable which can hold a higher figure. |
Support Snitz Forums
|
|
|
rsoxhater
Junior Member
120 Posts |
Posted - 19 June 2003 : 23:28:36
|
ok - give me a quick run down on how to do that davio - i can access the database via enterprise manager if needed.
Thanks davio!!! |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 19 June 2003 : 23:52:19
|
Would the database need to be changed as well ?
check the datatype of the field, I think it is longer than INTEGER (+/- 32767)
So it's just the CInt in your code needs to change to CLng, at various locations. |
|
|
rsoxhater
Junior Member
120 Posts |
Posted - 20 June 2003 : 00:32:46
|
lol i reread that davio - thanks, i changed those two instances and everything seems to work - thanks davio and laser! |
|
|
|
Topic |
|