#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    2
    Rep Power
    0

    Post Getting this error:Microsoft VBScript runtime error '800a01a8'


    My lookup function that creates a.txt lookuptable is giving thi error. The function looks like this:
    Function loadLookupList(ByVal luList, ByVal keyType, ByVal tblName, ByVal sortField)
    '
    ' load table into application dictionary
    '
    Dim oDB, oConn, oRs, sqlStmt
    Dim oFSO, oText, fn

    fn = Server.MapPath("/virtual") & "\lookups\lookup" & tblName & ".txt"
    sqlStmt = "SELECT * FROM " & tblName
    If sortField <> "" THen sqlStmt = sqlStmt & " ORDER BY " & sortField

    Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set oText = oFSO.CreateTextFile(fn,True)

    Set oDB = New clsDB
    result = oDB.Open
    If Not result Then Exit Function
    Set oConn = oDB.Connection

    Set oRs = oConn.Execute(sqlStmt)
    While Not oRs.Eof
    key = oRs(0)
    buffer = ""
    For i = 1 to oRs.Fields.Count - 1
    buffer = buffer & "#" & oRs.Fields(i)
    Next
    value = Mid(buffer, 2) ' strip leading #
    oText.WriteLine(key & "," & value)
    oRs.MoveNext
    Wend
    oText.Close

    result = luList.LoadValues(fn, keyType)

    loadLookupList = (result = 0)

    Set oFSO = Nothing
    Set oText = Nothing
    Set oRs = Nothing
    Set oConn = Nothing


    End Function

    The result = luList.LoadValues(fn, keyType), is giving this error :

    Microsoft VBScript runtime error '800a01a8'

    Object required: 'luList'

    //includes/DBLookup.asp, line 519

    Does anyone has any idea why ??? Your is very much needed.

    Thanks.
    Suran
  2. #2
  3. Web Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2001
    Location
    Pennsylvania
    Posts
    171
    Rep Power
    0
    The function looks okay. Can you post the code that is calling the function? Apparently the first parameter being passed isn't a valid object... that's what it seems to me. However, I am not an expert at ASP, so I may be wrong.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    2
    Rep Power
    0
    This is the calling function:

    Function initLookup()
    initLookup = loadLookupList(luProdClass, 12, "ProdClass", "Name")
    End Function

    Thanks for helping
    Suran
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Melbourne, Australia
    Posts
    212
    Rep Power
    12
    Have you identified line 519?
    My initial thoughts are that the object luList has not been initialised before calling the function, or that the luList you are passing is not set up correctly.
    How can I soar like an eagle when
    I'm flying with turkey's?

IMN logo majestic logo threadwatch logo seochat tools logo