473,545 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

populate dropdown from sproc

I am trying to populate a dropdown from a stored procedure, but I am
getting the error 'Object doesn't support this property or method:
'Next' :

<!--#include file="include_c onnection.asp"-->
<!--#include file="adovbs.in c"-->

<%

set objConn = server.createob ject("adodb.con nection")
objConn.open strConnection

%>
<table>
<form>
<tr>
<td bgcolor="cccccc " align="center"> <nobr><b>Client </nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>BDD</nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Status </nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Meetin g
Date</nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Brie f
Received</nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Respon se
Submitted</nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Site Visit</nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Decisi on
Due</nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Sign Off
Status</nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Sign Off
Month</nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Go Live</nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Activi ty
Type</nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Descri ption</nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Numb er of
Seats</nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Commer cials</nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Durati on</nobr></td>
<td bgcolor="cccccc " align="center"> <nobr><b>Commen ts</nobr></td>
</tr>
<tr>
<td bgcolor="cccccc " align="center"> <nobr>
<select name=CompanyNam es>
<%
set objCmd = server.CreateOb ject("ADODB.Com mand")
objCmd.ActiveCo nnection = strConnection
objCmd.CommandT ype = adCmdStoredProc
objCmd.CommandT ext = "GetCompanyName s"
set rsCompanyNames = objCmd.Execute

do while not rsCompanyNames. eof

'if a code has been selected, set it as selected

Response.Write "<option value=" &
rsCompanyNames( "companysitekey ") & " >"& rsCompanyNames( "name")
&"</option>"

rsCompanyNames. Next

loop

set rsCompanyNames = nothing
set objCmd = nothing
%>
</select>
</nobr></td>
<td>BDD</td>
<td></td>
</tr>
</form>
</table>

Can anybody help?

*** Sent via Developersdex http://www.developersdex.com ***
Jul 24 '07 #1
1 1652
Mike P wrote:
I am trying to populate a dropdown from a stored procedure, but I am
getting the error 'Object doesn't support this property or method:
'Next' :
Please don't multipost. This question was answered in the vbscrpt group you
posted to.

There is no method called Next. It's "MoveNext"
Your code would probably be more efficient if you used Getrows to move the
data into an array, allowing you to close your recordset and database
connection much sooner.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 24 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
16057
by: ImraneA | last post by:
Hi there Application : Access v2K/SQL 2K Jest : Using sproc to append records into SQL table Jest sproc : 1.Can have more than 1 record - so using ';' to separate each line from each other.
1
3602
by: jzhang29 | last post by:
I have a JSP page and it contains a dropdown list called Office. What I try to do is: When I select different office from this list, the information of office (address, phone,etc) will be populated in same JSP page. I have a java bean called officeBean that contains all the office information.
9
3309
by: Mike L | last post by:
I tried a sample of code in MSDN magazine, but now I'm stuck. What code has the best performance to populate a Data Grid with a SP? Below is the code I have, which might be completing the wrong way to populate a data grid. I like using code and not the server explorer. (I replaced the sa password for this post.) private void...
2
6319
by: Fraggle_Rock_1 | last post by:
I have a dataset like so |ID | type | Name ------------------ |1 | 1 | ham |2 | 2 | fish |1 | 2 | lard |2 | 1 | spam
0
1602
by: Kay O'Keeffe | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp textbox control which has a 'TextMode' property and when clicked on, displays as a dropdown list with 3 values, I want to have a similar type...
11
7367
by: eureka | last post by:
Hi All, I'm training in Servlets, JSP and JavaScript, I have a web page in which there's a "StudentName" textbox and below it is a "Names" Dropdown list. Initially the Textbox is empty and the Dropdown doesnt have any items.. The requirement is that as soon as one goes on typing the letters in the StudentName-textbox the corresponding...
1
1854
by: fran7 | last post by:
Hi, Anyone know how to populate a dropdown list with data from database. I have an interface that generates the following code for names in my database. ..asp <%If Trim(rsCard("Author"))<>"" Then%> <%=rsCard("Author")%><%End If%> .. How does one populate a dropdown list??
5
7921
by: ellen89 | last post by:
Hi All, I have a dropdown list control, and its items are loaded from database during the page_load. say, the values in the db table are not allowed to be NULL. I want to have the first row in dropdown list being blank. It means the user has to click the dropdown arrow to see the items. Thank you for your help in advance.
2
3036
by: FatBear | last post by:
Sorry for cross-posting this to microsoft.public.inetserver.asp.db - I didn't know if that group saw much action. Hi All, I'm very new to ASP and am now working on an existing site that is written in ASP. I'm trying to populate a dropdown box with the results of a query. There is current code that does this but it populates with team...
0
7484
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7415
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7440
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5997
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5344
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4963
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1030
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
726
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.