Hello. New here & looking for a little help. I'm an rookie. I have an append query that I need to run once an evening (M-F). I tried to use a task scheduler to open, autoexec a query, & close the DB but I ran into problems with the server kicking off the user running the task after 1 hour of no activity. The network guys are telling me I need to run some type of external script instead of trying to automatically open & close a database to make the query (SQL) statement run.



This is the SQL statement I am trying to run. It is based on 2 sub queries:

INSERT INTO Tbl_DailyDieStatus ( Product, StyleUP, QryDate, QryTime )
SELECT Qry_ProductStatus_Sub2.Product, IIf(Sum([ST_UP2])<2,0,-1) AS StyleUP, Date() AS QryDate, Time() AS QryTime
FROM Qry_ProductStatus_Sub2
GROUP BY Qry_ProductStatus_Sub2.Product, Date(), Time();

The access database is located on a local public drive
(example: P:\Toolroom\MFG_DieDB)

How would I setup a database link to this database in a script & run the above SQL to update my table?

Is this best done using a text file with .SQL extension?

I am using Access 2003 & Windows XP

Thanks alot for any replies