Hello William
You might wanna try something like this..
Dim oRstSrc as New ADODB.Recordset
Dim oRstDest as New ADODB.Recordset
Dim lConnection as New ADODB.Connection
dim strSQL as String
lConnection.CursorLocation = aduseServer or aduseclient
lconnection.ConnectionString = "specify your connection parameters"
lconnection.Open
strSQL = "SELECT * from TABLE"
oRstSrc.CursorLocation = adUseServer
oRstSrc.CursorType = adOpenDynamic
oRstSrc.LockType = adLockPessimistic
oRstSrc.Open strSQL, lConnection
Hope that helps
Regards
Brijesh Mathew
William Barnes - 28 Aug 2005 22:19 GMT
Thanks for your prompt reply, Brijesh
I'm not quite following your example. Basically what I want to do is to
reteieve a subset of records from an existing Recordset object. For example,
let's say I had a database containing info about books that resided on a
server somewhere. One day I retrieve a Recordset containing all the fields
of all the records from the Books table. Then, and this is one of the main
points, I save that recordset to the hard drive of my laptop as
MyRecset.adtg.
Now imagine that I am working somewhere without internet connectivity (thus
unable to connect to the original database on our server) and I want to
generate a subset of the records contained in MyRecset.adtg. For instance, I
might want to get a Recordset containing all records in which the
publication date was before a certain date.Thus I can do something like
this:
Dim oRecsetMain as Recordset
Const sLocalPath as String = "C:\MyDir\MyRecset.adtg"
oRecsetMain.Open sLocalPath
So now I have a Recordset containing all of the records from the main
database. But what I want is a Recordset that would be the same as that
which might have resulted from a query to the main database with something
like "SELECT * FROM Books WHERE PubDate < 10/31/1995".
How can I get a Recordset out of oRecsetMain that contains only those
records?
Thanks
WIlliam
> Hello William
>
[quoted text clipped - 21 lines]
>
> Brijesh Mathew
William
You might be interested in the assembly I've been working on at
http://www.queryadataset.com/recordsets.aspx. It lets you perform complex
SQL SELECT statements including UNION, JOINS, GROUP BY, HAVING, ORDER BY,
sub-queries, aggregates, functions etc against the recordsets. The
QueryRecordsets assembly allows Visual Basic 6.0 or ASP web developers to
perform complex SQL queries against cached ADO recordsets.
Hope this helps
Adrian Moore
http://www.queryadataset.com
> I'm working on a project in which I retrieve a recordset from a database
> and then save a local copy as an adtg file. What I'd like to do is then be
[quoted text clipped - 15 lines]
> Thanks,
> William
William Barnes - 28 Aug 2005 23:31 GMT
Thanks Adrian
I will have a look at that. Since my last post I've been playing around with
using the Recordset.Filter property. I may be able to get what I need with
that.
WIlliam
> William
>
[quoted text clipped - 28 lines]
>> Thanks,
>> William
Ellie - 30 Aug 2005 16:31 GMT
Hi William,
I just posted the same question.. Have you had any success?
Thanks,
Ellie
> Thanks Adrian
> I will have a look at that. Since my last post I've been playing around with
[quoted text clipped - 34 lines]
> >> Thanks,
> >> William