Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataReport Designer - Using Parameters 1

Status
Not open for further replies.

GerardMcL

Technical User
Aug 5, 2004
212
IE
Hi,
I have a DataEnvironment set up and in the SQL Builder I have
SELECT * FROM <table> WHERE ID = ?
Then in Parameters window
Param1 - set to Int
value = Enter ID
How do I take thi svalue and use it to define what records are shown in the report.

Dont think Im far off with this but cant get it working
Get message saying
Failed getting RowSet from data source
 
This i show I am doing :

If DataEnvironment1.CnnReport.State <> 0 Then DataEnvironment1.CnnReport.Close
DataEnvironment1.CnnReport.ConnectionString = "Provider=MSDataShape.1;Persist Security Info=False;Data Source=" & DataBaseLocation & ";Data Provider=MICROSOFT.JET.OLEDB.4.0"

DataEnvironment1.CnnReport.Open
DataEnvironment1.cmdReport iValue
rptReport.Show vbModal
DataEnvironment1.CnnReport.Close

CnnReport is the connection in the dataenvironment (called DataEnvironment1), cmdreport is the command and rptReport the datareport.

iValue is the parameter from my query.

If you want the user to enter the value, you could use an Inputbox or someting like that.


(Provider=MSDataShape because I use also child command - depending on your case, you might have to use another connection string - tell if you need help on this also)
 
see thread709-88923

It's a long post so do a search for RowSet on that page. There was never a reply to the fix so I don't know if it fixed the problem but I thought I would point you to it anyway since I could not reproduce your problem in my environment.

Hope it helps.

-GS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top