Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: 'funEmployer'

  • 14 years ago

    I'm trying to do a lookup through the following function:

    Function funEmployer(employerid)
    Set rsEmployerLookup = Server.CreateObject("ADODB.Recordset"
    )
    SQLEmployerLookup = "SELECT CompanyName FROM Employer WHERE ID = "
    & employerid
    Set rsEmployerLookup = objConn.Execute(SQLEmployerLookup)
    Response.Write rsEmployerLookup("CompanyName"

    )
    Set rsEmployerLookup = Nothing
    Set SQLEmployerLookup = Nothing
    End Function


    I'm passing the employerid through a hidden form field, first putting it in to a strEmployerID variable. Whenever I execute the code I get the following error message:

    Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: 'funEmployer'

    I've run functions like this in the past but cannot seem to get this de-bugged. Any ideas?

  • 14 years ago

    hello

     

    you must do that :

    SQLEmployerLookup = "SELECT CompanyName FROM Employer WHERE ID = "
    & cint(employerid)

     

    serval

  • 14 years ago
    Type Mismatch because if your employeeid is Interger value means
    error due to type Conversion From string to int so u try that one using Cint,because VBS take it as string by default

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are 10 types of people in the world, those who can read binary, and those who can't.”