Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Start a SQL job in Access

Author  Topic 

Riklinssen
Starting Member

20 Posts

Posted - 2009-01-15 : 09:47:34
Hello,
I've made a database with access as the frontend and SQL as the backend. I also mad a job in SQL and now I want to be able to start de SQL job with one push of a button in a Access form. Is this possible?

Thanks in advance.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-15 : 09:50:50
Yes.
You can click the button in Access which calls a stored procedure in SQL which starts the job for you.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

Riklinssen
Starting Member

20 Posts

Posted - 2009-01-29 : 03:14:48
I work with access 2007 and created a form in witch I want to run a Stored procedure. How can I select the stored procedure? I don't know what tool to use for that.

Thanks in advanced
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-01-29 : 03:25:32
Read about msdb..sp_start_job system stored procedure.
Or see http://weblogs.sqlteam.com/peterl/archive/2008/11/27/Run-jobs-synchronously.aspx


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

Riklinssen
Starting Member

20 Posts

Posted - 2009-03-11 : 06:42:54
I have a Stored procedure in SQL workgroup edition that starts a job. This works great. But I don't know how to run the stored procedure in access 2007 i've searched this forum and the internet but I can't find a solution.

Can someone explain it to me.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-03-11 : 06:52:04
The easy way is
Create a connection to the database. Execute a command string containing the name of stored procedure.

The correct way is to
1. Create a connection
2. Create a command object
3. Set command object type to stored procedure
4. Set name of stored procedure to command object command text.
5. Execute the command object.
6. Close and destroy the command object
7. Close and destroy the connection object



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -