Results 1 to 12 of 12
  1. #1
    Join Date
    Mar 2004
    Posts
    202

    Unanswered: help with list menu

    Hi there,

    I got this problem which i need to display out in the menu list box.
    Below is the coding for my program:

    <%
    Dim rs,dbConn, sqlCode
    Set dbConn=Server.CreateObject("ADODB.Connection") dbConn.Open "DSN=walao;UID=aaa;PWD=aaa"

    sqlCode="Select location as lo FROM transport where locationName = 'Dim Park'"
    set rs=dbConn.Execute(sqlCode)

    %><select name="try">
    <%do while not rs.EOF%>
    <option><%=rs("lo")%></option>
    <%
    rs.movenext
    loop
    rs.close
    %>
    </select>

    Actually the prob is that it can stop loading the page and later run time error will come out.
    I was thinking whether anyone out there can show me the way for me to list out all the data in the database into the menu list box.
    Thanx

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    How many records should your SQL return based on the contents of the transport table? Second, how many records are in the transport table? And lastly, is "locationName" in an index of that table (assuming this is not Access).
    That which does not kill me postpones the inevitable.

  3. #3
    Join Date
    Mar 2004
    Posts
    202
    Hi,

    The answer to the following question
    Question 1: Well, it can return either 1 record or 50 records.
    Qeustion 2: There are around 1000 records in the table
    Question 3: Nope.

    Hope that answer ur question.
    Thanx

  4. #4
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    What is the runtime error that you are getting??

  5. #5
    Join Date
    Mar 2004
    Posts
    202
    It says to long to load the page. I think its because it read the data in database in an unlimited loop

  6. #6
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    Too long to load the page,... never seen that before even with an endless loop,.. normally it stack overflows....

    It isn't because your query time is too long is it??

  7. #7
    Join Date
    Mar 2004
    Posts
    202
    Not really.....................when i run the page in localhost, it just cant load it and its not like cant load the page or sumting like that but its just cant finish loading.
    How?
    Thanx
    Last edited by michaelfg81; 05-07-04 at 04:38.

  8. #8
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Is that the only code on the page? It doesn't seem like that bit of code you posted could cause the error you're getting. Have you tried using a DSN-less connection instead (although, it seems very unlikely that it would make a difference)?
    That which does not kill me postpones the inevitable.

  9. #9
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    I notice you say when you run the page in localhost you have problems... what about when you run it elsewhere? does it work??

    If so I would guess a networking problem eg. you can't see the server with the database on it....

  10. #10
    Join Date
    Mar 2004
    Posts
    202
    if i run sumting else on localhost, it would be ok.i dun think its about connection as i think the page have problem with the coding or sumting alike.
    Last edited by michaelfg81; 05-09-04 at 21:15.

  11. #11
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    You probably want to post the whole page then, rather then just this portion of it....

  12. #12
    Join Date
    Mar 2004
    Posts
    202
    Its ok already.
    I manage to fix it.
    Thanx for ur help.I really appreciate it.

Posting Permissions

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