Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default ADO Recordset.Filter in Excel 2002

Hi All
Have been using Excel to generate custom reports on data from remote
databases quite happily.
I now have a need to avoid making lots of calls to the DB by downloading the
complete table concerned and using a rsABC.Filter in a loop to do a
different multi-column FIND in each iteration to get the various records I
need.
However any statement as ' rsABC.Filter "..." ' throws a compile error
'Invalid Use of property' with the '.Filter' highlighted.


Any suggestions as to what I am missing will be much appreciated.

TIA

Dash


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default ADO Recordset.Filter in Excel 2002

Make sure you set the RS "cursorlocation" to "client". I forget the exact
syntax.
Once the recordset is complete you can then disconnect it from the DB
(unless you're doing updates in which case you might be better off leaving
it connected).

Good code sample he
http://www.4guysfromrolla.com/webtech/080101-1.shtml


Tim



"Dash" wrote in message
...
Hi All
Have been using Excel to generate custom reports on data from remote
databases quite happily.
I now have a need to avoid making lots of calls to the DB by downloading
the complete table concerned and using a rsABC.Filter in a loop to do a
different multi-column FIND in each iteration to get the various records I
need.
However any statement as ' rsABC.Filter "..." ' throws a compile error
'Invalid Use of property' with the '.Filter' highlighted.


Any suggestions as to what I am missing will be much appreciated.

TIA

Dash



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default ADO Recordset.Filter in Excel 2002

Thanks Tim but I am still missing something!!
I used the 4guys example for a disconnected RS - as it in Excel VBA I had
to 'type' the Dim statements.
If I try to use the returned RS I get error msg. 'Operation not allowed when
the object is closed.'

If I comment out the lines in the 4guys function closing the oRS then the
returned rs is 'open'
i.e. RS.RecordCount returns without error.
but RS.Filter throws the same compile error 'invalid property assignment'

I tried typing the returned RS as Recordset, ADODB.Recordset and Variant

Anybody got any further thoughts??

Dash


"Tim Williams" <saxifrax at pacbell dot net wrote in message
...
Make sure you set the RS "cursorlocation" to "client". I forget the exact
syntax.
Once the recordset is complete you can then disconnect it from the DB
(unless you're doing updates in which case you might be better off leaving
it connected).

Good code sample he
http://www.4guysfromrolla.com/webtech/080101-1.shtml


Tim



"Dash" wrote in message
...
Hi All
Have been using Excel to generate custom reports on data from remote
databases quite happily.
I now have a need to avoid making lots of calls to the DB by downloading
the complete table concerned and using a rsABC.Filter in a loop to do a
different multi-column FIND in each iteration to get the various records
I need.
However any statement as ' rsABC.Filter "..." ' throws a compile error
'Invalid Use of property' with the '.Filter' highlighted.


Any suggestions as to what I am missing will be much appreciated.

TIA

Dash





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default ADO Recordset.Filter in Excel 2002

Post the code which doesn't work - it's easier than having us apply any
changes you may have made to the original.

Tim

--
Tim Williams
Palo Alto, CA


"Dash" wrote in message
...
Thanks Tim but I am still missing something!!
I used the 4guys example for a disconnected RS - as it in Excel VBA I had
to 'type' the Dim statements.
If I try to use the returned RS I get error msg. 'Operation not allowed

when
the object is closed.'

If I comment out the lines in the 4guys function closing the oRS then the
returned rs is 'open'
i.e. RS.RecordCount returns without error.
but RS.Filter throws the same compile error 'invalid property assignment'

I tried typing the returned RS as Recordset, ADODB.Recordset and Variant

Anybody got any further thoughts??

Dash


"Tim Williams" <saxifrax at pacbell dot net wrote in message
...
Make sure you set the RS "cursorlocation" to "client". I forget the

exact
syntax.
Once the recordset is complete you can then disconnect it from the DB
(unless you're doing updates in which case you might be better off

leaving
it connected).

Good code sample he
http://www.4guysfromrolla.com/webtech/080101-1.shtml


Tim



"Dash" wrote in message
...
Hi All
Have been using Excel to generate custom reports on data from remote
databases quite happily.
I now have a need to avoid making lots of calls to the DB by

downloading
the complete table concerned and using a rsABC.Filter in a loop to do

a
different multi-column FIND in each iteration to get the various

records
I need.
However any statement as ' rsABC.Filter "..." ' throws a compile error
'Invalid Use of property' with the '.Filter' highlighted.


Any suggestions as to what I am missing will be much appreciated.

TIA

Dash







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
Excel 2002 Filter Chris waller Excel Discussion (Misc queries) 4 August 24th 09 09:03 PM
excel 2002 data filter Ivanko New Users to Excel 2 February 14th 09 04:12 PM
Excel 2002: How to use Auto Filter ? Mr. Low Excel Discussion (Misc queries) 2 December 1st 08 07:38 AM
Excel 2002 - Is it possible to use Data,Filter,Autofilter as X-Axi Birmangirl Charts and Charting in Excel 5 May 1st 05 01:42 AM
Recordset Filter by Array Kou Vang[_2_] Excel Programming 0 February 1st 05 04:31 PM


All times are GMT +1. The time now is 09:36 AM.

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

About Us

"It's about Microsoft Excel"