ADO NextRecordset & Access

  • Thread starter Thread starter Alastair MacFarlane
  • Start date Start date
A

Alastair MacFarlane

Dear All,

I don't know whether this is an Access question or VB one so I have posted
this on 2 groups. Sorry for doing this.

Can I create a ADODB Recordset against an access database that works with
rs.Nextrecordset. I can open the recordset with "SELECT * FROM A; SELECT *
FROM B" but this only works with SQL Server.

Jet will generate an error because there are characters after the end (;) of
the SQL statement. A UNION query is not exactly the same thing and will not
work if the recordset objects have a different number of columns.

Any advice would be helpful.

Thanks again.

Alastair MacFarlane
(Posted on an Access and VB6.General newsgroup)
 
Alastair MacFarlane said:
Dear All,

I don't know whether this is an Access question or VB one so I have
posted this on 2 groups. Sorry for doing this.

Can I create a ADODB Recordset against an access database that works
with rs.Nextrecordset. I can open the recordset with "SELECT * FROM
A; SELECT * FROM B" but this only works with SQL Server.

Jet will generate an error because there are characters after the end
(;) of the SQL statement. A UNION query is not exactly the same thing
and will not work if the recordset objects have a different number of
columns.

Any advice would be helpful.

Thanks again.

Alastair MacFarlane
(Posted on an Access and VB6.General newsgroup)

Jet doesn't support queries that return multiple recordsets. A query
can contain only a single SQL statement. Well, technically it can
contain a PARAMETERS declaration and another SQL statement, but that's
it.

I suppose you might parse the initial set of SQL statements out into
separate queries, and open a separate recordset object on each. You
might manage these objects in a collection, so as to implement your own
equivalent of the NextRecordset method.
 
Dirk,

Thanks for this. I will just do it the way you advise, but I didn't think
you could do it.

Alastair
 
Back
Top