English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

my input code:

name="FCash" type="radio" value="Nice to Have">

The error I get:

Microsoft VBScript runtime error '800a005e'

Invalid use of Null: 'CStr'

/survey.asp, line 180

2006-09-05 08:42:03 · 4 answers · asked by Clock Watcher 4 in Computers & Internet Programming & Design

4 answers

You actually have several things here that are a mess...

First of all, make sure that your objRecSet object is created and contains a recordset. You can do this by checking EOF before you get to this input element. Your objRecSet("FCash") is coming out null. Which is why your Cstr function is failing.

Second, you appear to be comparing the same object. I am guessing this is so you can see if it writes "checked" into your input element so fair enough.

Third, there is no ternary operator in ASP 3.0 that I know of. It was one of the problems of 3.0 and has been resolved in .NET. You will either have to call a function there that returns "checked" or nothing or inline a proper if statement.

Fourth, you are right using one equal sign. The other answerer is thinking PHP/C/C++ style which requires the double equal sign.

Fix these things and then you should have no problem. Here is an example you could use....

<%
Function ReturnCheck(string1,string2)
If string1 = string2 then
ReturnCheck = " Checked "
End if
End Function
%>

name="FCash" value="Nice to Have">

Again, make sure that objRecSet is referring to the right column and that the recordset has records. Then you could use this function with numerous other radios making sure to pass in the comparison strings.

Hope it works out for you!

2006-09-05 09:59:06 · answer #1 · answered by Martyr2 7 · 0 0

hie..was my idea worked...i hope...okey...
i m not ASP guy so may b i am unable to give you code..but what i think happening over here is...

..the FCash...is field of table RIGHT??
is not having value always...means some rows are not havin FCash value..then it will not get any data here ...so CStr will be appliend on NULL like ( CStr(Null)) .. which is not accepted...so it gives error...

ALL THE BEST...

2006-09-05 08:55:40 · answer #2 · answered by patel.nachiket 2 · 0 0

I see two things:
a) You are using the If incorrectly, use two = as in ==
b) Ensure that both sides are not null values
Also why are you comparing the same thing, i.e. you are comparing CStr(objRecSet("FCash") with the same thing?????

2006-09-05 08:59:23 · answer #3 · answered by bostoncity_guy 2 · 0 1

Type your error message in here:

Runtime Errors and others:
http://support.microsoft.com/default.aspx?scid=kb;en-us;255058

Good Luck

2006-09-05 08:54:09 · answer #4 · answered by phy333 6 · 0 1

fedest.com, questions and answers