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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    VBScript runtime error 800a01a8 Object ...

    Hi, i have placed a new dropdown box on a page using the code below.
    When i open the form the dropdown box should be populated by a list of items from an SQL table. The table is called 'BUSINESS_UNITS' and the field is called 'Name'. However instead i am getting the following error:


    Select .... Microsoft VBScript runtime error '800a01a8' Object required: "/update_software/new_software.asp, line 157
    Line 157 = RS_DROP.Open "SELECT BUID, Name FROM BUSINESS_UNITS", adoCon

    Full code below ...

    Code:
    <tr><td width="120"><b>TEST BUS. UNIT # 1</b></td><td bgcolor='#DEDFEF' id="BUSINESS_UNIT">
    					
    <select class="text" name="BusinessUnit_ID"  style="width:190px;">
    <option value="">Select...  
    						
    <%
    RS_DROP.Open "SELECT BUID, Name FROM BUSINESS_UNITS", adoCon 
    do until RS_DROP.EOF
    strDrop = CInt(RS_DROP("BUID"))
    strDisplay = Trim(RS_DROP("Name"))
    strTemp = UCASE(strDisplay)
    response.write("<option value='" & strDrop & "' ")
    if CInt(strDrop)=CInt(strint) then	
    response.write("selected")
    end if
    response.write(">" & strDisplay)										
    RS_DROP.movenext
    loop
    RS_DROP.close
    %>	
    </select></td></tr>
    Any help appreciated.
    Thanks

  • #2
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,927
    Thanks
    46
    Thanked 203 Times in 202 Posts
    I don't see this declared "strint"
    but more importantly- is this a valid query (ie does it return valid results) in your SQL console?

    "SELECT BUID, Name FROM BUSINESS_UNITS"

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,613
    Thanks
    80
    Thanked 4,634 Times in 4,596 Posts
    No, that has nothing to do with that error, Alykins. If it was a SQL error, it would say so.

    The problem here is that he is trying to do
    Code:
    RS_DROP.Open ...
    but RS_DROP has never been created! In other words, just as the error says, "Object required." RS_DROP is not an object, so you can't call *ANY* method on it.

    *IF* adocon is an object-- a valid and ALREADY OPEN connection to the database--then that line could (and should) be rewritten as simply:
    Code:
    Set RS_DROP = adoCon.Execute( "SELECT BUID, Name FROM BUSINESS_UNITS" )
    If you do that, RS_DROP will automatically be created for you.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #4
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Yep. That line has worked.

    Thank you both for your contributions.


  •  

    Posting Permissions

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