Click to See Complete Forum and Search --> : Type mismatch: 'CLng' Error


theflyingminst
03-15-2009, 08:50 PM
Hi I am using Classic ASP and Access. I keep getting this error:

Type mismatch: 'CLng'

Is my SQL statement syntax incorrect?

strSQL = "SELECT * FROM Table WHERE id = " & CLng(string)


Thank you

Kuriyama
03-15-2009, 11:19 PM
SQL is correct it's the ASP/VBScript that is crashing

CLng will crash if you pass it a blank/null/non-numeric value. Also, I believe it will crash if you try to pass in a number exceeds CLngs number range.

theflyingminst
03-16-2009, 12:28 AM
Ok. Thanks for clearing that up, that really helps alot!!