Re: VBScript INT Type Mismatch

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



bxr222 wrote:
Hello All,
I am trying to pull a value out of a table and assign it to a variable and am getting type mismatch errors. Here is how I am trying to retrieve the value:
intLocation = Cint("Select Location_ID from Locations where Location_Code='" & strGroupLocation & "'")

The script errors out on that exact line with:
Microsoft VBScript runtime error: Type mismatch: 'Cint'
If I run the query in Query Analyzer it returns a numeric value. So, I am assuming the problem lies with VBScript. Thanks in advance for suggestions.

you are trying to convert the whole querystring to an INT ?

where do you get the table from ?

if you have the field you can do this

Cint(strLocationId)

br /\/\o\/\/

.



Relevant Pages

  • Re: vbscript, searching Active directory using ADODB type mismatch error
    ... It works when I echo the name but when I try to echo the decsription or ... homedirectory I get "Microsoft VBScript runtime error: Type mismatch". ... However, if either homeDirectory or description does not have a value, the ...
    (microsoft.public.windows.server.scripting)
  • Re: very very very very urgent and important
    ... At first it seemed to work fine in SeaMonkey 1.0.5, but when entering the secure area this message occoured: ... "Microsoft VBScript runtime error '800a000d' ... Type mismatch: 'ubound' ...
    (comp.sys.mac.apps)
  • Re: Format Percent
    ... Microsoft VBScript runtime error '800a000d' ... WScript.Echo FormatPercent(vVal, 2) vVal = Null WScript.Echo FormatPercent ... to verify that the last line does indeed raise a Type mismatch ...
    (microsoft.public.scripting.vbscript)
  • Bulk Insert type mismatch
    ... I'm trying to load a comma delimeter file into an sql database. ... the query analyzer and now I'm using VB.NET. ... uploading I get the error "type mismatch on the last column of upload file. ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: WMI to read DNS server properties script
    ... I ran this sample script against a W2K3 DNS server and got the following error: ... Microsoft VBScript runtime error: Type mismatch ... Any hints? ...
    (microsoft.public.windows.server.scripting)