www.webdeveloper.com
Results 1 to 7 of 7

Thread: Microsoft VBScript runtime error '800a01a8' Object required: ''

  1. #1
    Join Date
    Jan 2011
    Posts
    59

    Microsoft VBScript runtime error '800a01a8' Object required: ''

    Hi,

    I'm really struggling to display the following:

    <%response.Write(rsGetEFACsIAdd.Fields.Item("contactid").value)%>

    The error Object required: '' is shown when running the code?

    I'm running the code from this function:

    Function FGetEFACsAddress1(paddrcode, paddritem)
    Dim rsGetEFACsIAdd
    Dim rsGetEFACsIAdd_numRows
    Set rsGetEFACsIAdd = Server.CreateObject("ADODB.Recordset")
    rsGetEFACsIAdd.ActiveConnection = MM_conn_to_EFACs_STRING_ap
    rsGetEFACsIAdd.Source = "SELECT traderid, street, city, postcode FROM [efacdb].[dbo].[tradersaddresses] WHERE traderid = '" & paddrcode & "' AND addressid = '"& paddritem & "'"
    rsGetEFACsIAdd.CursorType = 0
    rsGetEFACsIAdd.CursorLocation = 2
    rsGetEFACsIAdd.LockType = 1
    rsGetEFACsIAdd.Open()
    rsGetEFACsIAdd_numRows = 0

    if NOT rsGetEFACsIAdd.EOF then
    ReturnVal = Trim(rsGetEFACsIAdd.Fields.Item("street").Value)
    else
    ReturnVal = "0"
    end if

    rsGetEFACsIAdd.Close()
    Set rsGetEFACsIAdd = Nothing
    FGetEFACsAddress1 = ReturnVal
    End Function

    The if not statement is returning true so I'm not sure where it is falling over?

    Thanks for the support

  2. #2
    Join Date
    Jan 2008
    Location
    Surprise, AZ
    Posts
    119
    I attempted the same thing, modifying the values to match items in my own database, and had no issues.
    What value types are paddrcode & paddritem? If they are numerical, in a numerically-defined field these should not have the apostrophes (') surrounding them. Also, I'm guessing the database/table structure ([efacdb].[dbo].[tradersaddresses]) works for other data for you, as this is something I obviously cannot test.

  3. #3
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    What line number does the error point to?

  4. #4
    Join Date
    May 2012
    Posts
    1

    Getting same VBScript runtime error

    Microsoft VBScript runtime error '800a01a8'
    Object required: ''
    /contact.asp, line 3

    HERE ARE LINES 1- 3 OF CODE
    1 <!-- #include file="config/header.asp" -->
    2 <%
    3 Set oRS = db_conn.Execute("SELECT * FROM cs_Contact WHERE ID=1")

    I HAVE NO IDEA WHAT'S GOING ON. I DO USE ASP/CASCADE FOR UPDATING PAGE AS WELL AS DREAMWEAVER FOR CERTAIN ELEMENTS.
    PLEASE HELP!

  5. #5
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    Where are you defining db_conn?

  6. #6
    Join Date
    Jan 2011
    Posts
    59
    All Sorted my end, trying to use an incorrect value against the database!

  7. #7
    Join Date
    Mar 2006
    Location
    Discworld
    Posts
    75
    Quote Originally Posted by mgalaxy View Post
    1 <!-- #include file="config/header.asp" -->
    2 <%
    3 Set oRS = db_conn.Execute("SELECT * FROM cs_Contact WHERE ID=1")
    can you post code from your header.asp file?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles