PDA

Click to See Complete Forum and Search --> : Syntax error??


HakanAzaklioglu
Jun 22nd, 2000, 08:35 PM
I always seem to have problems with sytax so here we go again...

This is the code that I have created to work on one of my pages:



<%IF rsRAM = "" THEN%>

<select size="1" name="ddRAM">
<option value="0">OPTION NOT AVAILABLE</option>
</select>

<%ELSE%>

<select size="1" name="ddRAM">
<option value="<%response.write rsRAM("SYSPRICE")%>"><%response.write rsRAM("DESCRIPTION")%></option>
</select>

<%END IF%>



The error message I am recieving is as follows:
Microsoft VBScript compilation error '800a0400'
Expected statement

And help would be apreciated... Thank you

Kind Regards,
Hakan

Clunietp
Jun 22nd, 2000, 10:21 PM
try this:

<option value=<%= chr(34) & rsRAM("SYSPRICE") & chr(34) %> ><%= rsRAM("DESCRIPTION") %></option>

HakanAzaklioglu
Jun 22nd, 2000, 11:05 PM
Here is the code that you suggested being implimented into the block of code that I am having trouble.



<%IF rsRAM = "" THEN%>

<select size="1" name="ddRAM">
<option value="0">OPTION NOT AVAILABLE</option>
</select>

<%ELSE%>

<select size="1" name="ddRAM">
<option value=<%= chr(34) & rsRAM("SYSPRICE") & chr(34) %> ><%= rsRAM("DESCRIPTION") %></option>
</select>

<%END IF%>



And here is the error message:

Microsoft VBScript runtime error '800a000d'
Type mismatch
/tvi/system_config.asp, line 76

Line 76 is the first line of code that has been cut and pasted above...

Any Suggestions

Kind Regards,
Hakan

Clunietp
Jun 23rd, 2000, 10:56 PM
I'm assuming rsRAM is a recordset, so you don't want to test for "". If you want to know if no records are found, use rsRAM.EOF

if rsRAM.eof = true then
'no record found
else
'record found
end if