Data Environment / Data Report
It been awhile since I used the Data Environment. One quick question.
How would I get the data report to print only one entry in a database?
I know I could use the SQL in the Command1 object, but I need to have the
user decide on what to view. I guess what I am asking is, how would I use
a custom SQL statement using varibles in code rather than using the command
Thanks for your help.
Re: Data Environment / Data Report
"Duane Snelling" <email@example.com> wrote:
>It been awhile since I used the Data Environment. One quick question.
>How would I get the data report to print only one entry in a database?
>I know I could use the SQL in the Command1 object, but I need to have the
>user decide on what to view. I guess what I am asking is, how would I use
>a custom SQL statement using varibles in code rather than using the command
>Thanks for your help.
You can do this by using a parameter in the sql of your command object.
First, in the DataEnvironment, edit your command and add your parameter(s)
in the where clause. You can do this by right-cliking on the command object
and selecting properties. Select "SQL Statement", and either type your sql
in the textbox or use the SQL Builder to create it. Either way, it should
look something like-
WHERE MyField = prmMyParam
Next, you can pass the value into the parameter before you open the report
by doing something like this-
Private Sub cmdOpenReport_Click()
Dim prm As ADODB.Parameter
If .rsMyCommand.State <> 0 Then
Set prm = .Commands("cmdMyCommand").Parameters("prmMyParam")
prm.Value = "Something"
Set prmMyParam = Nothing
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL