Property .Recordset of Reports

  • Thread starter Thread starter Marcus Becker
  • Start date Start date
M

Marcus Becker

I have created an unbound ADO-Recordset that i want to take as the
RecordSource (or Recordset) of a report:

Dim rst As New Recordset

With rst
.Fields.Append "Name", adVarChar, 255
.Fields.Append "Menge", adInteger
.Fields.Append "Nummer", adInteger
....etc
.Open

Filled with values:

.AddNew
!Nummer = intx
!Name = rstbest!Name
!Menge = 500
....etc.
.Update


and in the end:

DoCmd.OpenReport "rpt_ausgabe", acViewPreview
reports!rpt_ausgabe.recordset = rst
.Close
End With

which produces the error:
Run-time error '2593': This feature is not available in an MDB.

Does anybody know how to make this work? The knowlegde base isn't very
helpful.

Thanks
 
recordset is an object and requires the use of Set during assignment:

Set reports!rpt_ausgabe.recordset = rst

I can't guarantee this will solve all your problems, but at least it
reduces them by one. :-)

DAO vs ADO strikes me as another problematic area. Recordset is in both
object models and while you state "I have created an unbound ADO-Recordset"
it looks pretty much like DAO to me. Access might need that issue clarified
as well...
 
Am Mon, 28 Feb 2005 11:41:57 -0600 schrieb George Nicholson
recordset is an object and requires the use of Set during assignment:

Set reports!rpt_ausgabe.recordset = rst

I can't guarantee this will solve all your problems, but at least it
reduces them by one. :-)

You're right, of course ...
DAO vs ADO strikes me as another problematic area. Recordset is in both
object models and while you state "I have created an unbound
ADO-Recordset" it looks pretty much like DAO to me. Access might need
that issue clarified as well...

So I changed it to

Dim rst As New ADODB.Recordset

But the error message is still the same ...
 
Back
Top