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

parameter stored procedure 2

Status
Not open for further replies.

toekneel

Programmer
Aug 10, 2001
96
US
I have a stored procedure to run some complex table building. I have tested the sproc and it is running on the back end (SQL Server 2000) without any problem. The front end is MS Access Project 2000. My problem is that I need to pass a parameter from an input form in the front end into the parameter on the back end. I'm just not finding anything that helps me get my parameter accepted in the back end. I'm going to try to do some research in Tek-Tips archives today, but figured this might save me a little bit of time here.

Tony
ABQ, NM
 
Try this.

Dim Conn As ADODB.Connection
Dim Err As ADODB.Error

Set Conn = CurrentProject.Connection

Conn.Execute "execute spYourSPNAME @Parm = " & me.whatever

@Parm is whatever name you have in your stored procedure.
me.whatever is the contents you want to pass as a parameter.

Have a happy parm passing day.
 
Thanks a hundred times over! I have checked so many resources over the past week for what I figured had to be available code. You're a time-saving life-saver!

Tony
ABQ, NM
 
Your welcome. Also for your information. You can pass multiple parameters by keep stringing them along. I do it all over the place. Just watch you open and close quotes, it gets tricky sometimes. You have to seperate them by commas as below:

Conn.Execute "execute spYourSPNAME @Parm = " & me.whatever ", @Parm2 = " & me.whatever2

Have a nice weekend.
 
live can be so easy, sometimes "What a wonderfull world" - Louis armstrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top