View Single Post
 
Old June 19th, 2007, 07:16 PM
mat41 mat41 is offline
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

A couple of observations the sixth post (Posted - 06/20/2007 : 12:37:00 AM)

in relation to this code:

<select name="modProId">
sqlPull = "SELECT * FROM mainItems ORDER BY itemNumber desc"
             Set rs = conn.execute(sqlPull)
         Response.Write("<option value selected="">""</option>")
             Do while not rs.EOF
             Response.Write("<option value selected="& rs("itemNumber") &"> "& rs("itemNumber")&" </option>")
             rs.movenext
             Loop

> This is not how the code sits on the page, I can tell this from the lack of ASP delimiter tags. You should post code how it sits on the problematic page for the best help.
>Where is your closing </select> tag
>This line:
Response.Write("<option value selected="& rs("itemNumber") &"> "& rs("itemNumber")&"
What can you see wrong with it? It should be value="..." selected does not and should not be followed by an =
>You dont have a condition to check is there any records

Anyhow I will stop there, this is how I would write it:

<%
sqlPull = "SELECT * FROM mainItems ORDER BY itemNumber desc;"
Set rs = conn.execute(sqlPull)
if not rs.Eof then %>
   <select name="modProId">
    <option value="noRec">Select Item</option>
<% Do while not rs.EOF %>
      <option value="<%= rs("itemNumber") %>"><%= rs("itemNumber") %></option>
<% rs.movenext
   Loop
else
   response.write "no items found"
end if %>

Can you notice the differences? Constructivly - Poorly writen code is going to have problems in less forgiving browsers



Wind is your friend
Matt