473,396 Members | 1,998 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,396 software developers and data experts.

ADO: .movefirst ?

Hi,
Question : How can I iterate more than once over a query resultset ?

Usually this is how I connect to my odbcdatabase (classic stuff) :

$object=odbc_exec($con,$sql);
while ($row=odbc_fetch_array($object) {

blablah;

}

Now suppose I want to loop through it again, how do I reset the pointer to
the beginning ?
I realize doing $row[]=odbc_fetch_array is an option.
thx

Ward

Jul 17 '05 #1
1 2475
On Mon, 27 Sep 2004 09:11:14 GMT, Ward <ki************@for.president.com>
wrote:
Hi,
Question : How can I iterate more than once over a query resultset ?

Usually this is how I connect to my odbcdatabase (classic stuff) :

$object=odbc_exec($con,$sql);
while ($row=odbc_fetch_array($object) {

blablah;

}

Now suppose I want to loop through it again, how do I reset the pointer
to
the beginning ?
I realize doing $row[]=odbc_fetch_array is an option.
thx

Ward


Afaik, odbc_exec (preferably using odbc_prepare) or your suggestion are
the alternatives you have.

Using postgre you could use pg_result_seek..

--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 17 '05 #2

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

Similar topics

6
by: Felix McAllister | last post by:
Hi, When using win32com.client, how do you test for a 'nothing' com object as you can in VB? I have an example here when using ADO to loop over multiple recordsets returned from a query. I get the...
4
by: Jeremy | last post by:
Hi, I am having a problem running an sql stored procedure with ADO/ASP. If I hard code a select statement, the code works, but when I try to use a stored procedure it bombs. Here is my code: ...
2
by: datactrl | last post by:
Hi, all I've got an error such as "catastrophic failure" with the following staements: myRs=idXml.recordset; myRs.Find("invdate >#01/01/01#"); The error line is pointed to Find statement.
3
by: cannen | last post by:
This is a repost as I am down to the last hair on my head. I am using a listbox on a tab control on my mainform that has alisting of all records associated with form main record. when I select...
5
by: tony010409020622 | last post by:
I just spent 4 months taking a dotnet class where i learned very little. One of the things I did not learn is this: What are the dotnet equivilents of commands such as: Adodc1.Recordset.AddNew...
24
by: Donald Grove | last post by:
I want to populate an array with values from an ado recordset (multiple rows) I use the absolute position of the cursor in the recordset to define the row of my array to be populated. I have a...
3
by: igendreau | last post by:
I'm trying to clean up a database of mine, and I need to convert some old DAO code over to ADO. When I was using DAO, I had no problem running this script and deleting the record using rs.Delete. ...
6
by: Greg Strong | last post by:
Hello All, Is is possible to use an ADO recordset to populate an unbound continuous Subform? I've done some Googling without much luck, so this maybe impossible, but let me try to explain...
2
by: paulquinlan100 | last post by:
Hi I'm using the following code to retrieve some data from a seperate DB: Dim con As New ADODB.Connection con.Open _ "Provider=Microsoft.jet.oledb.4.0; Data Source=\...
3
ADezii
by: ADezii | last post by:
Last Tip, we demonstrated the technique for retrieving data from a DAO Recordset, and placing it into a 2-dimensional Array using the GetRows() Method. This week, we will cover the same exact Method...
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
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
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
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...
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
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...
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,...

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.