473,410 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

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_connection.asp"-->
<!--#include file="adovbs.inc"-->

<%

set objConn = server.createobject("adodb.connection")
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>Meeting
Date</nobr></td>
<td bgcolor="cccccc" align="center"><nobr><b>Brief
Received</nobr></td>
<td bgcolor="cccccc" align="center"><nobr><b>Response
Submitted</nobr></td>
<td bgcolor="cccccc" align="center"><nobr><b>Site Visit</nobr></td>
<td bgcolor="cccccc" align="center"><nobr><b>Decision
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>Activity
Type</nobr></td>
<td bgcolor="cccccc" align="center"><nobr><b>Description</nobr></td>
<td bgcolor="cccccc" align="center"><nobr><b>Number of
Seats</nobr></td>
<td bgcolor="cccccc" align="center"><nobr><b>Commercials</nobr></td>
<td bgcolor="cccccc" align="center"><nobr><b>Duration</nobr></td>
<td bgcolor="cccccc" align="center"><nobr><b>Comments</nobr></td>
</tr>
<tr>
<td bgcolor="cccccc" align="center"><nobr>
<select name=CompanyNames>
<%
set objCmd = server.CreateObject("ADODB.Command")
objCmd.ActiveConnection = strConnection
objCmd.CommandType = adCmdStoredProc
objCmd.CommandText = "GetCompanyNames"
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 1645
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
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
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...
9
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...
2
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
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...
11
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...
1
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"))<>""...
5
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...
2
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...
0
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...

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.