I receive the following error when there is no value for querystring. (I mean like index.asp?ID=).
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: ""]'
index.asp, line 10
I tried converting NULL value to something else with the following code. It did not work.
MEMBERID = Request.QueryString("ID")
If MEMBERID = "" or MEMBERID = 0 Then
MEMBERID = Session("MEMBERID")
End If
This error indicates that Access cannot match an input value to the data type it expects for the value. For example, if you give Access a text string when it is expecting a number, you receive a data type mismatch error.
These error messages occur because VBScript cannot properly convert adNumeric values to a valid numeric type. This behavior is by design.
VBScript run-time errors are errors that result when your VBScript script attempts to perform an action that the system cannot execute. VBScript run-time errors occur while your script is being executed; when variable expressions are being evaluated, and memory is being dynamic allocated.
OK, you're getting the parameter ID from the QueryString and checking if it's empty or zero, right? So, you should do something like:
MemberId = Request.QueryString("ID")
'*
'* Check for other than numbers just to be safe
'*
If (MemberId = "" Or Not IsNumeric(MemberId)) Then
MemberId = Session("MemberId")
End If
'*
'* We can't add this check on the above if because
'* in classic ASP, the expression is evaluated as a whole
'* which would generate an exception when converting to Int
'*
If (CInt(MemberId) = 0) Then
MemberId = Session("MemberId")
End If
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With