...

View Full Version : Microsoft VBScript runtime (0x800A01A8)



AliB
01-11-2007, 12:27 AM
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 "

Spudhead
01-11-2007, 12:13 PM
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.

AliB
01-11-2007, 07:41 PM
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

dev
01-13-2007, 09:21 AM
Hi,

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

regards
Dev

AliB
01-13-2007, 03:59 PM
yes...

degsy
01-15-2007, 12:04 PM
You still need to say if you've defined the recordset object.

Also, don't use On Error code whilst debugging.

Spudhead
01-15-2007, 05:08 PM
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 :eek:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum