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

Stored Procedure Query 1

Status
Not open for further replies.

raybetts

Programmer
Apr 27, 2000
6
CH
I have an SP which requires to dates being passed to it and the result should open a report.&nbsp;&nbsp;I have set this up in the dataenvironment and grouped it as i only want to see the parent details once and child details many times.<br><br>I know how to pass the params to sql 7 when I physically code the connection - cmd.param.value(0) = xx/xx/xxxx.<br><br>But how do i do this with using the dataenvironment?&nbsp;&nbsp;I have to do it this way as i want my report grouping.&nbsp;&nbsp;If you know how to do this or even a totally different way which is more efficient then you advice will be received with great joy!<br><br>Cheers,<br><br>Ray.
 
DataEnvironment1.Commands(&quot;your_command_name_here&quot;).Parameters(1) = &quot;whatever&quot;
 
What if i'm not using the dataenvironment what do I do? I use regular SET and open recordsets and stuff like that, but what's the other alternative?
 
There is another way to do from DataEnvoirment i.e.<br>Define a variable for command string e.g. gSqlStr in your declare section.<br>gSqlStr = &lt;&quot;Your SP Name &quot;&gt; &quot;'&quot; & &lt;Your Parameter&gt; & &quot;'&quot;<br>Define local recordset object<br>Dim rs1 as ADODB.RecordSet<br>Set rs1 = &lt;DataEnvoirment&gt;.&lt;EnvoirmentConnection&gt;.Execute(gSqlStr)<br><br>You will get local recordset and you can use that for your report or within the program for readonly purpose.<br>
 
Hello,
I am using VB6.0 to communicate with MS Access, version 2000. I am interested in using a parameterized query to display results to a grid in VB. I have the parameterized query stored in Access. I have tried
DataEnvironment1.Commands(&quot;your_command_name_here&quot;).Parameters(1) = &quot;whatever&quot; and using querydefs.

What is the command to pass a parameter to MS Access to run the stored query?

Thanks for any help....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top