Thread: Error Help

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2007
    Location
    Dela-Where?
    Posts
    42
    Rep Power
    8

    Error Help


    Hello,

    I should start off as saying I am a complete noob to asp. I am normally an PHP developer but I need to do a quick ASP project for my boss. I have this code so far:

    Code:
    <%
    
    dim errors
    
    call email_validate()
    
    function email_validate()
        Dim required(7), data, errors(), check
        
        required(0) = "name"
        required(1) = "phone"
        required(2) = "address"
        required(3) = "city"
        required(4) = "state"
        required(5) = "zip"
        required(6) = "email"
        
        Set data=Server.CreateObject("Scripting.Dictionary")
        data.Add "name",""
        data.Add "phone",""
        data.Add "address",""
        data.Add "city",""
        data.Add "state",""
        data.Add "zip",""
        data.Add "email",""
        data.Add "comments",""
        
        For Each check In required
           If Not IsEmpty(Request.QueryString(check)) Then data.Item(check) = Request.QueryString(check) End If
        Next
        
    end function
    
    %>
    Which throws this error:

    Request object error 'ASP 0102 : 80004005'

    Expecting string input

    /test.asp, line 29

    The function expects a string as input.

    What am I missing? Thanks for your help.
    "Bart Stop Pestering Satan!" - Marge Simpson
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,444
    Rep Power
    4539
    What's line 29?
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2007
    Location
    Dela-Where?
    Posts
    42
    Rep Power
    8
    Originally Posted by Doug G
    What's line 29?
    Line 29 would be:

    Code:
    If Not IsEmpty(Request.QueryString(check)) Then data.Item(check) = Request.QueryString(check) End If
    I have narrowed it down to this part of that line:

    Code:
    Request.QueryString(check)
    "Bart Stop Pestering Satan!" - Marge Simpson
  6. #4
  7. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,444
    Rep Power
    4539
    Perhaps request.querystring(check) is null. In vbscript a null is not a string value and you can't convert null to a string. I used to use something like this as a workaround for dealing with nulls
    Code:
    if len(whatever) > 0 then
     ' something is in whatever
    else
     ' whatever is null or an empty string
    end if
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester

IMN logo majestic logo threadwatch logo seochat tools logo