Results 1 to 4 of 4

Thread: Syntax error??

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    63

    Question

    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

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    try this:

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

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    63
    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

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width