Reports - Recordsources?

R

Randy

Hello NG -

Newbie ? Somewhat.

Access 2003 on a windows 200 os - connecting to a windows server 2003 os
with a SQL Server 2000 db. I am making a coonection to the server and
returning for a stored procedure a recordset. I want this recordset to be
the recordsource of a report - My thought process is I either have to turn
my mdb into an adp which as of this point I am hesitant to do or move the
recordset to a temporary table within access and then have the report draw
its recordsource from this table which in my mind is doing double the work
for the singular task.
Bottom line Can an ADO recordset be used for a report recordsource?

TIAFAH

Randy
 
G

Guest

Yes you can.

A quote from help files follows.
You should probably specify full settings for the connection string instead
of using "CurrentProject.Connection" since you are connecting to a table in
different database.



QUOTE:

The following example opens a form, opens a recordset, and then binds the
form to the recordset by setting the form's Recordset property to the newly
created Recordset object.

Global rstSuppliers As ADODB.Recordset
Sub MakeRW()
DoCmd.OpenForm "Suppliers"
Set rstSuppliers = New ADODB.Recordset
rstSuppliers.CursorLocation = adUseClient
rstSuppliers.Open "Select * From Suppliers", _
CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Set Forms("Suppliers").Recordset = rstSuppliers
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top