recordset eof 
Author Message
 recordset eof

I've never experienced this before.

In regards to the code below.

Does anyone know what could cause the 3rd line of code to take 15 seconds.
(If rsAppcovl1.EOF = False Then)

             rsAppcovl1.MaxRecords = 1
            rsAppcovl1.Open sqlString, cn

            If rsAppcovl1.EOF = False Then
            end if

Thanks.



Sat, 17 Apr 2004 03:04:17 GMT  
 recordset eof
Hi Mark,

Opening of recordset can be 15 or more seconds. It depends
on many factors (network traffic, selection criteria). In
your case probably sqlString does not have any WHERE
clause or this statement retrieves huge number of records.
I think even if you set MaxRecords to 1 it does not mean
that SQL statement will select only 1 record. It will
select all of them and ADO recordset will take only 1
record from retrieved recordset.
If you want to select only 1 record and you are using SQL
Server then you can use TOP 1 clause in SELECT statement
to provide that:

SELECT TOP 1 MyField1, MyField2 FROM MyTABLE WHERE ...

Val

Quote:
>-----Original Message-----
>I've never experienced this before.

>In regards to the code below.

>Does anyone know what could cause the 3rd line of code to
take 15 seconds.
>(If rsAppcovl1.EOF = False Then)

>             rsAppcovl1.MaxRecords = 1
>            rsAppcovl1.Open sqlString, cn

>            If rsAppcovl1.EOF = False Then
>            end if

>Thanks.

>.



Sat, 17 Apr 2004 04:07:59 GMT  
 recordset eof
The opening of the recordset only takes a second, the problem is when it
checks for EOF.
The following line is extremely slow.

"If rsAppcovl1.EOF = False Then"

Thanks.


Quote:
> Hi Mark,

> Opening of recordset can be 15 or more seconds. It depends
> on many factors (network traffic, selection criteria). In
> your case probably sqlString does not have any WHERE
> clause or this statement retrieves huge number of records.
> I think even if you set MaxRecords to 1 it does not mean
> that SQL statement will select only 1 record. It will
> select all of them and ADO recordset will take only 1
> record from retrieved recordset.
> If you want to select only 1 record and you are using SQL
> Server then you can use TOP 1 clause in SELECT statement
> to provide that:

> SELECT TOP 1 MyField1, MyField2 FROM MyTABLE WHERE ...

> Val

> >-----Original Message-----
> >I've never experienced this before.

> >In regards to the code below.

> >Does anyone know what could cause the 3rd line of code to
> take 15 seconds.
> >(If rsAppcovl1.EOF = False Then)

> >             rsAppcovl1.MaxRecords = 1
> >            rsAppcovl1.Open sqlString, cn

> >            If rsAppcovl1.EOF = False Then
> >            end if

> >Thanks.

> >.



Sat, 17 Apr 2004 04:23:14 GMT  
 recordset eof
How fast does RecordCount return a value?

If not too long, you could use that as a qualifier if doing things such as
traversing the recordset.

Casey


Quote:
> The opening of the recordset only takes a second, the problem is when it
> checks for EOF.
> The following line is extremely slow.

> "If rsAppcovl1.EOF = False Then"

> Thanks.



> > Hi Mark,

> > Opening of recordset can be 15 or more seconds. It depends
> > on many factors (network traffic, selection criteria). In
> > your case probably sqlString does not have any WHERE
> > clause or this statement retrieves huge number of records.
> > I think even if you set MaxRecords to 1 it does not mean
> > that SQL statement will select only 1 record. It will
> > select all of them and ADO recordset will take only 1
> > record from retrieved recordset.
> > If you want to select only 1 record and you are using SQL
> > Server then you can use TOP 1 clause in SELECT statement
> > to provide that:

> > SELECT TOP 1 MyField1, MyField2 FROM MyTABLE WHERE ...

> > Val

> > >-----Original Message-----
> > >I've never experienced this before.

> > >In regards to the code below.

> > >Does anyone know what could cause the 3rd line of code to
> > take 15 seconds.
> > >(If rsAppcovl1.EOF = False Then)

> > >             rsAppcovl1.MaxRecords = 1
> > >            rsAppcovl1.Open sqlString, cn

> > >            If rsAppcovl1.EOF = False Then
> > >            end if

> > >Thanks.

> > >.



Sat, 17 Apr 2004 04:34:40 GMT  
 recordset eof
Hi Mark,

It looks strange. Try to play with cursor location of your
recordset.

Val

Quote:
>-----Original Message-----
>The opening of the recordset only takes a second, the
problem is when it
>checks for EOF.
>The following line is extremely slow.

>"If rsAppcovl1.EOF = False Then"

>Thanks.



>> Hi Mark,

>> Opening of recordset can be 15 or more seconds. It
depends
>> on many factors (network traffic, selection criteria).
In
>> your case probably sqlString does not have any WHERE
>> clause or this statement retrieves huge number of
records.
>> I think even if you set MaxRecords to 1 it does not mean
>> that SQL statement will select only 1 record. It will
>> select all of them and ADO recordset will take only 1
>> record from retrieved recordset.
>> If you want to select only 1 record and you are using
SQL
>> Server then you can use TOP 1 clause in SELECT statement
>> to provide that:

>> SELECT TOP 1 MyField1, MyField2 FROM MyTABLE WHERE ...

>> Val

>> >-----Original Message-----
>> >I've never experienced this before.

>> >In regards to the code below.

>> >Does anyone know what could cause the 3rd line of code
to
>> take 15 seconds.
>> >(If rsAppcovl1.EOF = False Then)

>> >             rsAppcovl1.MaxRecords = 1
>> >            rsAppcovl1.Open sqlString, cn

>> >            If rsAppcovl1.EOF = False Then
>> >            end if

>> >Thanks.

>> >.

>.



Sat, 17 Apr 2004 04:36:58 GMT  
 recordset eof
Hi,

RecordCount is not reliable way to define that because it
depends on provider and cursor type. Some of combinations
will not return real record count.

Val

Quote:
>-----Original Message-----
>How fast does RecordCount return a value?

>If not too long, you could use that as a qualifier if

doing things such as
Quote:
>traversing the recordset.

>Casey



>> The opening of the recordset only takes a second, the
problem is when it
>> checks for EOF.
>> The following line is extremely slow.

>> "If rsAppcovl1.EOF = False Then"

>> Thanks.



>> > Hi Mark,

>> > Opening of recordset can be 15 or more seconds. It
depends
>> > on many factors (network traffic, selection
criteria). In
>> > your case probably sqlString does not have any WHERE
>> > clause or this statement retrieves huge number of
records.
>> > I think even if you set MaxRecords to 1 it does not
mean
>> > that SQL statement will select only 1 record. It will
>> > select all of them and ADO recordset will take only 1
>> > record from retrieved recordset.
>> > If you want to select only 1 record and you are using
SQL
>> > Server then you can use TOP 1 clause in SELECT
statement
>> > to provide that:

>> > SELECT TOP 1 MyField1, MyField2 FROM MyTABLE WHERE ...

>> > Val

>> > >-----Original Message-----
>> > >I've never experienced this before.

>> > >In regards to the code below.

>> > >Does anyone know what could cause the 3rd line of
code to
>> > take 15 seconds.
>> > >(If rsAppcovl1.EOF = False Then)

>> > >             rsAppcovl1.MaxRecords = 1
>> > >            rsAppcovl1.Open sqlString, cn

>> > >            If rsAppcovl1.EOF = False Then
>> > >            end if

>> > >Thanks.

>> > >.

>.



Sat, 17 Apr 2004 05:06:19 GMT  
 recordset eof
try this

do until rsAppcovl1.EOF
....
loop

it's working good

=================================
Take Care
tark

| I've never experienced this before.
|
| In regards to the code below.
|
|
| Does anyone know what could cause the 3rd line of code to take 15 seconds.
| (If rsAppcovl1.EOF = False Then)
|
|              rsAppcovl1.MaxRecords = 1
|             rsAppcovl1.Open sqlString, cn
|
|             If rsAppcovl1.EOF = False Then
|             end if
|
|
| Thanks.
|
|



Mon, 19 Apr 2004 07:55:44 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. RecordSet EOF property

2. Recordset.EOF

3. Checking for recordset.EOF is very slow

4. Recognize between Recordset EOF and Record is locked

5. Recordset EOF

6. Are you capable of stopping a Do While Not Recordset.EOF ... Loop?

7. 230101 - FIX Data Queries Sporadically Return Empty Recordsets - EOF BOF - Not enough storage is available to complete this operation

8. Are you capable of stopping a Do While Not Recordset.EOF ... Loop?

9. BOF/EOF Problem in Database Application (ADO Recordset)

10. The EOF never get True in a recordset

11. Error 3021 ( recordset returns either EOF or BOF is TRUE)

12. Error 3021 ( recordset returns either EOF or BOF is TRUE)

 

 
Powered by phpBB® Forum Software