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

  • 10 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?

  • 10 years ago

    hello

     

    you must do that :

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

     

    serval

  • 10 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.

“PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals.” - Jon Ribbens