Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default ADO - recordset find performance slow

I have a couple of applications that use ADO to update recordsets (SQL) from
an excel interface.

After opening a recordset, I set it to the beginning of the file and then do
a find.

It works, but takes several minutes to find the record.

There are only a few hundred records.
I can use the CopyFromREcordset all records appear in seconds.

I'm using the Find to select the record to edit.

Any ideas how I can speed things up?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default ADO - recordset find performance slow

have you tried querying only for the record you want?

--
Regards,
Tom Ogilvy


"Ken Valenti" wrote:

I have a couple of applications that use ADO to update recordsets (SQL) from
an excel interface.

After opening a recordset, I set it to the beginning of the file and then do
a find.

It works, but takes several minutes to find the record.

There are only a few hundred records.
I can use the CopyFromREcordset all records appear in seconds.

I'm using the Find to select the record to edit.

Any ideas how I can speed things up?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default ADO - recordset find performance slow

I guess I don't know how to do that.
Here's a code snippet of what I have.
I don't see query from variable "rs"


Sub TestIt()
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
cn.Open TheConnectionString
Set rs = New ADODB.Recordset
rs.Open TheRStable, cn, adOpenKeyset, adLockOptimistic, adCmdTable
rs.Find "criteria here"
'Close connections, etc
End Sub


"Tom Ogilvy" wrote:

have you tried querying only for the record you want?

--
Regards,
Tom Ogilvy


"Ken Valenti" wrote:

I have a couple of applications that use ADO to update recordsets (SQL) from
an excel interface.

After opening a recordset, I set it to the beginning of the file and then do
a find.

It works, but takes several minutes to find the record.

There are only a few hundred records.
I can use the CopyFromREcordset all records appear in seconds.

I'm using the Find to select the record to edit.

Any ideas how I can speed things up?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ADO - recordset find performance slow

http://support.microsoft.com/kb/294349/en-us

Look at the SQL string they build - the "Select * from . . . "

--
Regards,
Tom Ogilvy


"Ken Valenti" wrote in message
...
I guess I don't know how to do that.
Here's a code snippet of what I have.
I don't see query from variable "rs"


Sub TestIt()
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
cn.Open TheConnectionString
Set rs = New ADODB.Recordset
rs.Open TheRStable, cn, adOpenKeyset, adLockOptimistic, adCmdTable
rs.Find "criteria here"
'Close connections, etc
End Sub


"Tom Ogilvy" wrote:

have you tried querying only for the record you want?

--
Regards,
Tom Ogilvy


"Ken Valenti" wrote:

I have a couple of applications that use ADO to update recordsets (SQL)
from
an excel interface.

After opening a recordset, I set it to the beginning of the file and
then do
a find.

It works, but takes several minutes to find the record.

There are only a few hundred records.
I can use the CopyFromREcordset all records appear in seconds.

I'm using the Find to select the record to edit.

Any ideas how I can speed things up?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default ADO - recordset find performance slow

Thanks, Worked perfectly.

Performance went from several minutes to a couple seconds!


"Tom Ogilvy" wrote:

http://support.microsoft.com/kb/294349/en-us

Look at the SQL string they build - the "Select * from . . . "

--
Regards,
Tom Ogilvy


"Ken Valenti" wrote in message
...
I guess I don't know how to do that.
Here's a code snippet of what I have.
I don't see query from variable "rs"


Sub TestIt()
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
cn.Open TheConnectionString
Set rs = New ADODB.Recordset
rs.Open TheRStable, cn, adOpenKeyset, adLockOptimistic, adCmdTable
rs.Find "criteria here"
'Close connections, etc
End Sub


"Tom Ogilvy" wrote:

have you tried querying only for the record you want?

--
Regards,
Tom Ogilvy


"Ken Valenti" wrote:

I have a couple of applications that use ADO to update recordsets (SQL)
from
an excel interface.

After opening a recordset, I set it to the beginning of the file and
then do
a find.

It works, but takes several minutes to find the record.

There are only a few hundred records.
I can use the CopyFromREcordset all records appear in seconds.

I'm using the Find to select the record to edit.

Any ideas how I can speed things up?






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default ADO - recordset find performance slow

Worked way fast to read the record.

But now I can't edit the data.



"Tom Ogilvy" wrote:

http://support.microsoft.com/kb/294349/en-us

Look at the SQL string they build - the "Select * from . . . "

--
Regards,
Tom Ogilvy


"Ken Valenti" wrote in message
...
I guess I don't know how to do that.
Here's a code snippet of what I have.
I don't see query from variable "rs"


Sub TestIt()
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
cn.Open TheConnectionString
Set rs = New ADODB.Recordset
rs.Open TheRStable, cn, adOpenKeyset, adLockOptimistic, adCmdTable
rs.Find "criteria here"
'Close connections, etc
End Sub


"Tom Ogilvy" wrote:

have you tried querying only for the record you want?

--
Regards,
Tom Ogilvy


"Ken Valenti" wrote:

I have a couple of applications that use ADO to update recordsets (SQL)
from
an excel interface.

After opening a recordset, I set it to the beginning of the file and
then do
a find.

It works, but takes several minutes to find the record.

There are only a few hundred records.
I can use the CopyFromREcordset all records appear in seconds.

I'm using the Find to select the record to edit.

Any ideas how I can speed things up?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fast then slow performance Daniel Bonallack Excel Programming 3 May 30th 06 10:40 PM
pivot table from recordset - very slow performance [email protected] Charts and Charting in Excel 1 May 14th 06 04:05 PM
Very slow performance while exploring. Gargoyl Excel Discussion (Misc queries) 1 April 24th 06 08:51 AM
Spreadsheet performance is slow Kristi Excel Worksheet Functions 7 January 5th 06 03:17 PM
ADO slow recordset getrows RB Smissaert Excel Programming 4 August 10th 03 08:22 PM


All times are GMT +1. The time now is 04:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"