creating a report from sql server data

S

sisernhagen

I created an access front-end to a sql server database and I'm stuck
trying to generate a report via a event procedure. I purposely am not
using linked tables and instead connect to the DB using a ADO
connection string. I cant figure out how to base a report on a query
where the tables are not linked. I want to be able to use a ADO
connection string to query the db and base a report on it. How do I do
this?

Any ideas would be extreamly appreciated!!!

Thanks

Seth
 
S

shumaker

This is an example of how I create a report in an Access Data Project
that uses SQL server 2000 as back end, this is in the Report Open
event, and I think CountsCombined is a function or stored procedure. I
construct the string using user selected values in a custom form, and
then call up the report passing the string as a parameter. Then in the
reports on open event I get the paramter and set it to Me.RecordSource:

strRecordSource = "Exec CountsCombinedDescrNoSumChild '" &
Me![BeginDate] & "','" & Me![ChildCombo] & "','118'"

So basically you use the "Exec" keyword followed by the query name and
comma seperated list of parameters, each one in single quotes. I'm not
sure the details of if the query name has to be the name of an existing
SP, view, or function.
 

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