 |
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: stored procedures Archived to Disk
If you mean, the DataReport and DataEnvironment built into VB (DataProject). Then you just:
1) select the connection, go to properties, enter all the proper information.
2) Add a command
(To see if any procedures exist)
3a) select stored procedure, then see if the procedure exists
3b) Use the SQL statement, enter the procedure name, followed by the parameter.
Now as far as dynamically... You can try to modify the command via code like the following:
DataEnvironment1.rsCommand1.Source = "StoredProcedure Parameters"
DataEnvironment1.rsCommand1.Open
Or use a temp table.
IE. Create the SQL command to get the results, then insert the results into a temporary table, then have a command and report just display the results from the temp table, not the original command. Then clear the temp table.
|
|
09-05-2002 at 05:34 PM |
|
|
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: stored procedures Archived to Disk
In the data reoprt properties:
DataSource = DataEnvironment
DataMember = Whatever pops upin the box (the SQL statements, commands etc).
|
|
10-05-2002 at 08:35 PM |
|
|
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: stored procedures Archived to Disk
Then you have to right click the report, click retrieve structure.
Open up the connection form, expand the procedure and drag the fields to the report, or just drag the command to the report.
(edit message still doesn't work)
|
|
10-05-2002 at 08:37 PM |
|
|
JLRodgers Level: Moderator
 Registered: 04-04-2002 Posts: 1617
|
Re: stored procedures Archived to Disk
If you can get just a plain table to work with the data report (displaying and everything)... Then I don't have any ideas as to why it doesn't work.
I have one last idea before giving up:
1) On the connection, you have a command,SQL statement or something that's used to open the procedure.
2) Select the properties
3) click on Advanced
4) Make sure "Recordset Returning" is selected
5) Accept, close the dialog
6) Select the same item in step 1
7) Select "Design"
8) You have the SQL command that'll be executed, Right click in the top pane (you need the menu with "Run" in it)
9) Click "run"
10) if you see the results you expect, then I have no clue, if you don't, modify the SQL statement as to get the results you're expecting and try the report again. (when you close the designer, it'll ask if you want to save the changes)
Like I said, if the above doesn't do anything, I have no other ideas. Good luck.
|
|
12-05-2002 at 10:50 PM |
|
|
|
|
 |
 |