473,473 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Loop Through a recordset

Hello,

I am trying to get data from a stored procedure and then loop through that
recordset to fill a ListBox (ASP code). However, I am getting the error:
'EOF' is not a member of 'System.Data.OleDb.OleDbDataAdapter'.

Any help with this wold be appreciated.

'Populate the BusinessUnit combo box
'-----------------------------------
Dim spBusinessUnit As OleDbDataAdapter, strBusinessUnitBox As String
spBusinessUnit = New OleDbDataAdapter("sp_web_Search " &
"'FindBusinessProduct','','',''", cnnSearch)
spSearch.SelectCommand.CommandType = CommandType.StoredProcedure

Do While not spBusinessUnit.EOF
strListBox = spBusinessUnit("BusinessProduct_ID")
strBusinessUnitBox = strBusinessUnitBox & "<option value=" & strQuote &
strListBox & strQuote & ">" & strListBox & "</option>"
spBusinessUnit.MoveNext
Loop

--
Thanks in advance,

Steven
Nov 18 '05 #1
1 2751
try it like this..

----------------------------
Dim spBusinessUnit As OleDb.OleDbDataReader, strBusinessUnitBox As String
Dim cmd As New OleDb.OleDbCommand("sp_web_Search " & _
"'FindBusinessProduct','','',''", cnnSearch)
cmd.CommandType = CommandType.StoredProcedure

spBusinessUnit = cmd.ExecuteReader()
Do While spBusinessUnit.Read
strListBox = spBusinessUnit("BusinessProduct_ID")
strBusinessUnitBox = strBusinessUnitBox & "<option value=" & strQuote
& strListBox & strQuote & ">" _
& strListBox & "</option>"
Loop
spBusinessUnit.Close()

----------------

"Steven K" <sk****@troop.com> wrote in message
news:Os**************@tk2msftngp13.phx.gbl...
Hello,

I am trying to get data from a stored procedure and then loop through that
recordset to fill a ListBox (ASP code). However, I am getting the error:
'EOF' is not a member of 'System.Data.OleDb.OleDbDataAdapter'.

Any help with this wold be appreciated.

'Populate the BusinessUnit combo box
'-----------------------------------
Dim spBusinessUnit As OleDbDataAdapter, strBusinessUnitBox As String
spBusinessUnit = New OleDbDataAdapter("sp_web_Search " &
"'FindBusinessProduct','','',''", cnnSearch)
spSearch.SelectCommand.CommandType = CommandType.StoredProcedure

Do While not spBusinessUnit.EOF
strListBox = spBusinessUnit("BusinessProduct_ID")
strBusinessUnitBox = strBusinessUnitBox & "<option value=" & strQuote &
strListBox & strQuote & ">" & strListBox & "</option>"
spBusinessUnit.MoveNext
Loop

--
Thanks in advance,

Steven

Nov 18 '05 #2

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

Similar topics

4
by: Ken Fine | last post by:
I'm trying to include a list of people that's the result of looping through a recordset in a CDONTS mail. I'm trying to Dim the output of a loop, and it ain't working -- I'm getting a syntax error....
0
by: Sue Adams | last post by:
I actually have two issues/questions: I have an autonumber field in an access db table that I grab and later use to update a record in another table withing the same db. The code I use to get...
5
by: !TG | last post by:
I currently use Do while loop, but I'd rather use a For Loop though I have never gotten the hang of them. Would some one please be so kind as to show me how to loop through a recordset.
10
by: Ronny Sigo | last post by:
Hello all, Could anybody give me the correct syntax for defining a loop using the form's recordset for as long as it is not at the end of the table ? example: Do While not EOF ' this is the...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
4
by: keithsimpson3973 | last post by:
Hi. I have a loop that was written for me by some outstanding programmers here (willakawill and killer42). It works great if I only select one record to check for duplicates. The user can pick on one...
3
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Here is my loop and it runs fine: ---------------------------------------------------- sSQL = "SELECT * FROM STORE_ITEMS" Set DataRec = DB.execute(sSQL) if not DataRec.EOF then do while not...
4
MMcCarthy
by: MMcCarthy | last post by:
The following code is simply an example of some code that processes through two recordsets. It can be helpful for anyone curious as to how to start processing with recordsets (Which objects to refer...
1
by: hmiller | last post by:
Hey Guys, I'm just playing around with some code I wrote for work and am trying to minimize the coding as much as possible. So two questions: 1. What are your best practices for organizing...
8
by: SaltyBoat | last post by:
Needing to import and parse data from a large PDF file into an Access 2002 table: I start by converted the PDF file to a html file. Then I read this html text file, line by line, into a table...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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,...
1
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.