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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reporting

Status
Not open for further replies.

devdba

Programmer
Dec 11, 2002
15
0
0
GB
I m using sqlserver7 and vb6 to make a small database project. i am quite familiar with sql server7 but new to vb interace designing.
i wish to learn how can i run a data report that is based on a stored procedure which accepts argument.
my basic problem is that how can i pass arguments to a stored procedure which runs a report (like two dates or and specific customer/item code etc.)
 
Use the dataenvironment to connect with the database
then use datareport.
You can use a SQL statement to filter the records and a variable parameter by including in the SQL WHERE FirstName=? and set the parameter name and type in the Dataenvironment command1 properties tab.
You then assign the parameter to a text or combo box in the sub that runs the report.
Eg.
Dataenvironment1.rsCommand1 DataComboBox.Boundtext
DataReport1.show

Then use the dataenvironment as the recordsource for the report.

You can have child fields and use any SQL command

There are examples in the MSDN disk.

Better still use the Crystal reports add in that is packaged with Vb6. Its like MSAccess but it runs from VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top