Forum Moderators: open
i have tried to add in a module to my previous written message board. i have a field in the database which have a numberic data type. and now i would like to edit the field from the form. but i seem having problem with the datatype.
it return an error saying "Type mismatch:" so perhaps i think it have something to do with the datatype. correct if i'm wrong. so how i would convert the form input to numberic instead of string. ( i currently have two page where else the 1st page will pass the form value to the next and the 2nd page would request.form to get all the input data.) thanks for helping =)
num1 = request.form("str")
num1 = cInt(num1)
..
.. ( database connection )
rs2("myfield") = num1
this is what i did but i still get the same error.
it further said that Type mismatch: 'cInt'
i think i might did something really stupid with the cInt
Note: The value must be a number between -32768 and 32767.
The CLng function converts an expression to a variant of subtype Long.
Note: The value must be a number between -2147483648 and 2147483647.
Other conversions available are CSng and CDbl
so i would like to know is there a way to change it to numberic value back? because i having a numberic data type in the database.
Are you sure iif's work in asp/vbScript :)
Nope, not sure...... 8)
I use JScript for my ASP coding and use the ternary operator very often. In regular VB I use the IIF all over the place, and just assumed that it worked in VBScript.
So....I guess it doesn't?
In that case you'll have to use the long IF, Then, Else