Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-10-2007, 11:27 PM   PM User | #1
AliB
New to the CF scene

 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
AliB is an unknown quantity at this point
Unhappy Microsoft VBScript runtime (0x800A01A8)

hi
im having problems with this code

<!-- Top 10 posters -->
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
<tr class="tableLedger">
<td colspan="10">Top 10 Posters</td>
</tr>
<%
intTempRecord = 0
intTotalRecords = 0
Const strMBV_TP_R = 10
strSQL = "SELECT "
strSQL = strSQL & " TOP " & strMBV_TP_R & " "
strSQL = strSQL & strDbTable & "Author.Author_ID, " & strDbTable & "Author.Username, " & strDbTable & "Author.Group_ID, " & strDbTable & "Author.Last_visit, " & strDbTable & "Author.No_of_posts, " & strDbTable & "Author.Join_date, " & strDbTable & "Author.Active, " & strDbTable & "Group.Name, " & strDbTable & "Author.Avatar " & _
"FROM " & strDbTable & "Author " & strDBNoLock & ", " & strDbTable & "Group " & strDBNoLock & " " & _
"WHERE " & strDbTable & "Author.Group_ID = " & strDbTable & "Group.Group_ID AND " & strDbTable & "Author.Active = " & strDbTrue & " " & _
"ORDER BY " & strDbTable & "Author.No_of_posts DESC; "

On Error Resume Next

rsCommon.Open strSQL, adoCon

'If Err.Number <> 0 Then Call errorMsg("An error has occured while executing SQL query on database.", "get_last_USR_+_count", "default.asp")

On Error goto 0

'Place the recordset into an array
If NOT rsCommon.EOF Then

'Read the recordset into an array
saryTopPosters = rsCommon.GetRows()

'read total records
intTotalRecords = Ubound(saryTopPosters,2) + 1
End If

'Close recordset
rsCommon.close

if intTotalRecords = 0 then
Response.Write("<tr class=""tableRow""><td colspan=""10"">" & strTxtNoForumPostMade & "</td></tr>")
else
%>
<tr class="tableRow" align="center"><%
Do While intTempRecord < intTotalRecords
if intTempRecord = 10 then exit Do
Response.Write("<td><a href=""member_profile.asp?PF=" & saryTopPosters(0, intTempRecord) & strQsSID2 & saryTopPosters(0, intTempRecord) & "', '" & saryTopPosters(1, intTempRecord) & "')""><img src=""" & saryTopPosters(8, intTempRecord) & """ alt=""" & strTxtType & ": " & saryTopPosters(2, intTempRecord) & vbCrlf & strTxtPosts & ": " & saryTopPosters(4, intTempRecord) & vbCrlf & strTxtLastActive & ": " & DateFormat(saryTopPosters(3, intTempRecord)) & """ class=""avatar"" onError=""this.src='avatars/blank_avatar.jpg';""><br />" & saryTopPosters(1, intTempRecord) & "</a></td>")
intTempRecord = intTempRecord + 1
Loop
%>
</tr>

</table>
<% End if %>
<br />

<!-- End Top 10 Posters -->

the error im receiving is Microsoft VBScript runtime (0x800A01A8)
Object required
/forum/default.asp, line 804

line 804 is "If NOT rsCommon.EOF Then "
AliB is offline   Reply With Quote
Old 01-11-2007, 11:13 AM   PM User | #2
Spudhead
Senior Coder

 
Spudhead's Avatar
 
Join Date: Jun 2002
Location: London, UK
Posts: 1,856
Thanks: 8
Thanked 110 Times in 109 Posts
Spudhead is on a distinguished road
Hmm. Not sure. I think you'll need to dim your recordset variable, or at least set it:

dim rsCommon
set rsCommon = server.createobject("ADODB.Recordset")

And I'd take out the error handling stuff.
Spudhead is offline   Reply With Quote
Old 01-11-2007, 06:41 PM   PM User | #3
AliB
New to the CF scene

 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
AliB is an unknown quantity at this point
here is the complete code for the file i am trying to modify...if i take out the code i posted above everyother rscommon command works..so its not the defining the variable ... i think...and its a modification to webwizforums that i am trying to do
Attached Files
File Type: txt default.txt (40.7 KB, 106 views)
AliB is offline   Reply With Quote
Old 01-13-2007, 08:21 AM   PM User | #4
dev
New Coder

 
Join Date: Jan 2007
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
dev is an unknown quantity at this point
Hi,

Where u r defining or declaring the recordset is it coming from other page ?

regards
Dev
dev is offline   Reply With Quote
Old 01-13-2007, 02:59 PM   PM User | #5
AliB
New to the CF scene

 
Join Date: Jan 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
AliB is an unknown quantity at this point
yes...
AliB is offline   Reply With Quote
Old 01-15-2007, 11:04 AM   PM User | #6
degsy
Senior Coder

 
Join Date: Nov 2002
Location: North-East, UK
Posts: 1,265
Thanks: 0
Thanked 0 Times in 0 Posts
degsy is on a distinguished road
You still need to say if you've defined the recordset object.

Also, don't use On Error code whilst debugging.
degsy is offline   Reply With Quote
Old 01-15-2007, 04:08 PM   PM User | #7
Spudhead
Senior Coder

 
Spudhead's Avatar
 
Join Date: Jun 2002
Location: London, UK
Posts: 1,856
Thanks: 8
Thanked 110 Times in 109 Posts
Spudhead is on a distinguished road
Why are you reusing their recordset object? I can't see any obvious reason why your code shouldn't work, admittedly, but trying to add functional code to a 1000-line page built by someone else is always gonna be hard. Trying to do it with their variables just seems masochistic
Spudhead is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:34 AM.


Advertisement
Log in to turn off these ads.