|
-
Feb 23rd, 2000, 08:18 PM
#1
i am trying to put some run time parameters into a data report. so the sql statement is being created out side the report, but the connection to the db is done within the report, how do i (a) pass the sql statement to the connection or (b) pass it straight to the report?
-
Feb 23rd, 2000, 09:56 PM
#2
Hyperactive Member
What are you using as the data source? Are you using the Data Environment? If so, this is what I suggest: First read the section "Writing a report" in part 6 of the Visual Basic Database Tutorial on this website (don't remember the exact address so you will have to do a search).
This is how I change the SQL at run time when using the Data Environment and Data Reports. I make a hypothetical SQL statement at design time in the Data Environment where I have the structure designed the way I want it later (I don't worry about filters, WHERE statements, or anything at this time; I only need to define the relations between the tables. The tutorial will show you how to do this).
The defined structure has a property called the Hierarchy Info that you can view by right-clicking on the top command. I copy this SQL from the window and then paste it into a subroutine, like this:
Code:
Private Sub Command1_Click()
MyDataEnvironment.Commands("Command1").CommandText = 'enter the SQL here and make the modifications to the parameters
End Sub
-
Feb 23rd, 2000, 10:32 PM
#3
thanks a lot , that worked perfectly
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|