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

access front end with SQL Server backend question 1

Status
Not open for further replies.

maswien

Technical User
Sep 24, 2003
1,286
CA

Does anybody know how to call a SQL Server stored procedure from access front end? Thanks
 
Yes, create a pass-through query with SQL similar to this:

EXEC SPname parameters

eg EXEC SPclosedcases '01/07/2002', '31/07/2005', -1

Hope this helps
 

Thanks for the reply!

Is it possible to generate a passthrough query like that in VBA code, and run it when user click a submit button on the form?
 
try using adp instead of mdb files adp stands for access data project and was made especially to work with sql-server.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
This has already been answered, but you can also do it this way from VBA inside of Access

Code:
dbcnn.execute "execute EXEC SPclosedcases '01/07/2002', '31/07/2005', -1"

This is similiar to how you would handle it with any ADO connection. Where dbcnn is your open connection..

Randall Vollen
National City Bank Corp.
 


Thanks for the replay!

chrissie1, I don't have knowlegde on ADP, is there any reading sources for this on internet?

hwkranger, that for sure helps!

I am trying to find a way to protect the access front end user from changing or viewing the tables in SQL Server, so I want grant the execute permission of stored procedure to the access user and not grant the write permission directly to the access user, is there any other method to do this from access?
 
btw,

that should read

dbcnn.execute "EXEC SPclosedcases '01/07/2002', '31/07/2005', -1"

no idea what I was thinking while I typed.


Randall Vollen
National City Bank Corp.
 

Is this possible to get the return value from the stored procedure? thanks
 
Yes... You can open it as a recordset

Randall Vollen
National City Bank Corp.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top