Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Move to specific row in an ADODB.recordset

 
   Database Help (Home) -> Visual Basic RSS
Next:  Simple Table but having query issues  
Author Message
Olaf Jung

External


Since: Oct 25, 2009
Posts: 2



(Msg. 1) Posted: Sun Oct 25, 2009 6:25 pm
Post subject: Move to specific row in an ADODB.recordset
Archived from groups: microsoft>public>vb>database (more info?)

Hello!

I would like to move to a specific row in a recordset.
For example I would like to get the value "MyText" from the 100. row.
A very slow approach would be

dim l&
for l = 1 to rs.recordcount
if l = 100 then
...

Is there a faster way to go to that specific row?

Thank you for help.

Olaf Jung

 >> Stay informed about: Move to specific row in an ADODB.recordset 
Back to top
Login to vote
Ralph

External


Since: Jan 28, 2008
Posts: 34



(Msg. 2) Posted: Mon Oct 26, 2009 5:01 am
Post subject: Re: Move to specific row in an ADODB.recordset [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Olaf Jung" wrote in message

> Hello!
>
> I would like to move to a specific row in a recordset.
> For example I would like to get the value "MyText" from the 100. row.
> A very slow approach would be
>
> dim l&
> for l = 1 to rs.recordcount
> if l = 100 then
> ...
>
> Is there a faster way to go to that specific row?
>
> Thank you for help.
>
> Olaf Jung

ADODB.Recordset.AbsolutePosition

However, not every provider or cursor will support this method, nor is
it guaranteed to point always point to the same record (only what is the
current 100th).

-ralph

 >> Stay informed about: Move to specific row in an ADODB.recordset 
Back to top
Login to vote
Norm Cook

External


Since: Aug 27, 2003
Posts: 4



(Msg. 3) Posted: Mon Oct 26, 2009 6:17 am
Post subject: Re: Move to specific row in an ADODB.recordset [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Olaf Jung" wrote in message

> Hello!
>
> I would like to move to a specific row in a recordset.
> For example I would like to get the value "MyText" from the 100. row.
> A very slow approach would be
>
> dim l&
> for l = 1 to rs.recordcount
> if l = 100 then
> ...
>
> Is there a faster way to go to that specific row?
>
> Thank you for help.
>
> Olaf Jung

Perhaps
MoveFirst
Move 100
 >> Stay informed about: Move to specific row in an ADODB.recordset 
Back to top
Login to vote
argusy

External


Since: May 01, 2004
Posts: 2



(Msg. 4) Posted: Mon Oct 26, 2009 9:25 am
Post subject: Re: Move to specific row in an ADODB.recordset [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Olaf Jung wrote:
> Hello!
>
> I would like to move to a specific row in a recordset.
> For example I would like to get the value "MyText" from the 100. row.
> A very slow approach would be
>
> dim l&
> for l = 1 to rs.recordcount
> if l = 100 then
> ...
>
> Is there a faster way to go to that specific row?
>
> Thank you for help.
>
> Olaf Jung


in your select statement, start with
SELECT TOP 100 ......
When recordset is opened
Movelast
(Warning - it might not be what you expect,
depending on ORDER BY <parameter> in the query)
 >> Stay informed about: Move to specific row in an ADODB.recordset 
Back to top
Login to vote
Olaf Jung

External


Since: Oct 25, 2009
Posts: 2



(Msg. 5) Posted: Wed Oct 28, 2009 3:25 am
Post subject: Re: Move to specific row in an ADODB.recordset [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Back to top
Login to vote
Display posts from previous:   
Related Topics:
How to do a SELECT on a RecordSet - How would I do a SELECT on a ADODB.RecordSet? I have created the recordset from an Oracle database using a Select statement with a Group By. Now I need to Select from that result and further Group By and Sum. The logic of the statements don't allow for....

sql query returns in wrong format - Hi, Hope someone can help me with this. I have MS SQL 2000 database where i have Table "PriceList" and there a column "Pricemk" wich is data type "money". All data in this column is in form "10001,35". So why when...

arrays - is there a way to concatenate the contents of an array (looping through the array) and storing each item in a comma delimited string? Thanks!

DataReport PageBreak - Hi everyone, I would like to know how to force pagebreak in a datareport for example after 5 records printed. Thank you all

Possible Use of a Cursor - I have a complex query that I hope I can explain it well enough for everyone to understand. I have a table that contains information for work instructions. Contained in the table are "MACHINE_PROC" these are groupings of machining processes....
   Database Help (Home) -> Visual Basic All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]