Link to home
Start Free TrialLog in
Avatar of deneuve
deneuve

asked on

Scheduler needed

Where can I get a scheduler to run procedures in Acces at certain times. e.g I want to do time calculations for employees at 1AM in the morning.

Thanks

deneuve
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

use the Windows Scheduler to start your EXE. You can find it into the Control Panel under "Scheduled Tasks".
Avatar of robbert
robbert

In case your operation system doesn't have the Windows Scheduler (like Win9x, NT4), you can also use the DOS AT command (for help type: "at /?") or a VB scheduler:
http://www.vbadmincode.btinternet.co.uk/winnt.htm#Scheduling

To run Access procedures from an VB EXE, you would code something like:

    Dim objAccess   As Access.Application
   
    objAccess.OpenAccessProject "path"
    objAccess.Run "procedure", "argument"
I wrote a simple VB scheduling application that allows you to schedule the running of an EXE at either daily (you pick the time), weekly (you pick the day of the week) or monthly (you pick the day of the month) intervals.  You specify the path to the EXE and some other basic information.

Then, in your case, you'd need some code as robbert is suggesting that could be a VB EXE that will instantiate an Access Application object and run whatever queries, or macros you have there (the code for this would be pretty simple to prototype for you.

If you'd like the vb scheduling code, post an e-mail address and I'll send it along.  I haven't opened the project for a long while, so, I don't know if it uses any special OCXs (I'm pretty sure that it was a VB 3 application).  If it does, then you might have a little work ahead to get it working again, but it's a good place to start.
Avatar of deneuve

ASKER

Thanks mdougan

my email is deneuve@eircom.net

I do not intend to open Access to update the tables
Could I build in the scheduler into my app so that the user can schedule the tasks from within the app.I want to call procedures from within the app to update the tables and so have everything as one unit.

Or perhaps I should have several exes corresponding to the different night jobs that has to be run then if I need to modify one of these jobs I need only recompile the small exe

what do you think experts

Kathy
Avatar of deneuve

ASKER

The reason I am not opening Access is that users may have different versions of Access so there would be a problem

Kathy
Avatar of deneuve

ASKER

I have just re read my question. I am sorry for misleading you all.
I think your question was clear.  

"Or perhaps I should have several exes corresponding to the different night jobs that has to be run then
if I need to modify one of these jobs I need only recompile the small exe"

This is the way that I've done it in the past.  Let the scheduler concentrate on scheduling, let the little EXEs concentrate on doing whatever they need to do.

Can you give an example of one of the types of updates you want to do?  If you want to update rows in a table, then you're correct, you can do that with just ADO queries.  If you wanted to run a macro that you've already created in your access database, then you'd do that with OLE Automation and Access objects.

I'll send off the scheduler tonight when I get home.
Avatar of deneuve

ASKER

Thanks again Mike.

I have not written the the updates yet but they will be just ADO queries and a lot of them. I want to stay away from using Access objects so that I do nothave to handle Version problems.

Look forward to the scheduler

Kathy
ASKER CERTIFIED SOLUTION
Avatar of mdougan
mdougan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of deneuve

ASKER

Thanks Mike for the scheduler and the Parameter example. This will be helpful as there are a lot of O's in this part of the world O'Brien, O'Donnell, O'Meara....and on and on and on.

Kathy
Avatar of deneuve

ASKER

You have done a great job on the scheduler. It works fine and the code is very clear. Hope to be in touch again

Thank You

Kathy
Anytime, thanks Kathy!
scheduler needed?
Avatar of deneuve

ASKER

Nice one robbert!!

Kathy
Hi mdougan,

appreciate if you can provide me the code for your scheduler. I'm working on an app to read from an access table as a reminder for many, many, events per day, week, month, etc. email is kltan@rocketmail.com

Thanks, Kee Leong.

Ref:
https://www.experts-exchange.com/questions/20298665/Scheduler-needed.html
hey mdougan,

could you please sent me your scheduler code? i'm building an app to grab records from excel, update access tables, write to a log, then send out some emails based on the updates, and i'm trying to figure out how to do schedule based work, like executing DTS packages, but using only VB in Access. as in the above, i only need to execute ADO updates and inserts based on the data i import, then figure out the mail piece. but i'd love to get a peek at your scheduler to help me along.

thanks!

jonDavid

EE@jondavid.com

Sure, as long as you promise not to turn around and sell your code (including my code) as a scheduling program that competes with mine. (doesn't sound like it would).  You can download the runtime version from my website at:

www.greatsoftware.net

I'll send the code from home later on.

Mike
hey mdougan,

could you please sent me your scheduler code? i'm building an app to grab records from excel, update access tables, write to a log, then send out some emails based on the updates, and i'm trying to figure out how to do schedule based work, like executing DTS packages, but using only VB in Access. as in the above, i only need to execute ADO updates and inserts based on the data i import, then figure out the mail piece. but i'd love to get a peek at your scheduler to help me along.

thanks!

jonDavid

EE@jondavid.com

thanks! I appreciate it very much! so you know, I have no intention of making your code a product or selling it or anything like that - just want to build a tool to enhance my non-commercial, very lite CRM application. i'll probably hack it up beyond recognition, as that's generally how i learn.

thanks again,

jonDavid
Hi mdougan

Would you mind sending you scheduling code to one more person? Not a very experienced VB programmer and need to find a way to schedule record alterations in a database. email is mac@iol.ie.

Thanks
JoshuaAMS