Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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 "

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    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.

  • #3
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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 Attached Files

  • #4
    dev
    dev is offline
    New Coder
    Join Date
    Jan 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

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

    regards
    Dev

  • #5
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes...

  • #6
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You still need to say if you've defined the recordset object.

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

  • #7
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •