If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > help with list menu

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-06-04, 04:27
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
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
Reply With Quote
  #2 (permalink)  
Old 05-06-04, 12:26
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #3 (permalink)  
Old 05-06-04, 19:43
michaelfg81 michaelfg81 is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 05-06-04, 19:54
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
What is the runtime error that you are getting??
Reply With Quote
  #5 (permalink)  
Old 05-06-04, 21:31
michaelfg81 michaelfg81 is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 05-06-04, 22:49
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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??
Reply With Quote
  #7 (permalink)  
Old 05-07-04, 03:28
michaelfg81 michaelfg81 is offline
Registered User
 
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 03:38.
Reply With Quote
  #8 (permalink)  
Old 05-07-04, 10:14
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #9 (permalink)  
Old 05-09-04, 19:00
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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....
Reply With Quote
  #10 (permalink)  
Old 05-09-04, 19:57
michaelfg81 michaelfg81 is offline
Registered User
 
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 20:15.
Reply With Quote
  #11 (permalink)  
Old 05-09-04, 21:41
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
You probably want to post the whole page then, rather then just this portion of it....
Reply With Quote
  #12 (permalink)  
Old 05-10-04, 20:10
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
Its ok already.
I manage to fix it.
Thanx for ur help.I really appreciate it.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On