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

Execute SQL Server Stored Procedure from Pass Through Query

Status
Not open for further replies.

GrommitAPW

Programmer
Jan 25, 2001
7
BE
I am converting an Access system to have a SQL Server Backend. For performance reasons I want to convert queries to stored procedures & run them using pass through queries. In a pass through query I am using the syntax

EXEC sp_test (5)

which works fine. However I would like to pass a value from a field on a form, instead of hard-coding the parameter in the EXEC statement. Is this possible ?

Can anybody help ?

Thanks,
Adrian
 
you need to change the stored query in vba:

dim qd as querydef
set qd=currentdb.querydefs("query1")
qd.sql="EXEC sp_test (" & me.text1 & ")"
qd.execute
 
Thanks for the advice ... I'll give it a go.

Regards, Adrian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top