![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I need to run a process using a timer. The process needs to be running all day long. We are looking for a way to ensure that the program is running, and, if not, then relaunch it. Some thoughts I had were: 1) Find a utility that runs in the background and checks periodically if the db is running, and, if not, relaunches it. 2) Write some code in Access VBA or in VB that checks to see if the database is open, launches it if it doesn't, and then closes itself. The small program could be launched from Windows Scheduler every 15 minutes or so. 3) Other. #1 would be ideal. Anyone know of anything like that? I figure there must be something like this, given the need to run processes continually. #2 would be fine. But, while I know I can check if Access is running by using GetObject, I don't know how I would then check to see if that specific database is open (or if there are multiple instances of Access running). Any ideas? Thanks, Neil |
#3
| |||
| |||
|
|
"Neil" <neil.ginsberg+newsgr... (AT) gmail (DOT) com> wrote in message news:jpet2i$bme$1 (AT) dont-email (DOT) me... I need to run a process using a timer. The process needs to be running all day long. We are looking for a way to ensure that the program is running, and, if not, then relaunch it. Some thoughts I had were: 1) Find a utility that runs in the background and checks periodically if the db is running, and, if not, relaunches it. 2) Write some code in Access VBA or in VB that checks to see if the database is open, launches it if it doesn't, and then closes itself. The small program could be launched from Windows Scheduler every 15 minutesor so. 3) Other. #1 would be ideal. Anyone know of anything like that? I figure there must be something like this, given the need to run processes continually. #2 would be fine. But, while I know I can check if Access is running by using GetObject, I don't know how I would then check to see if that specific database is open (or if there are multiple instances of Access running). Any ideas? Thanks, Neil If you are OK with Windows Scheduler, have it open you Access program and have Access exit when done.- Hide quoted text - - Show quoted text - |
#4
| |||
| |||
|
|
I need to run a process using a timer. The process needs to be running all day long. We are looking for a way to ensure that the program is running, and, if not, then relaunch it. Some thoughts I had were: 1) Find a utility that runs in the background and checks periodically if the db is running, and, if not, relaunches it. 2) Write some code in Access VBA or in VB that checks to see if the database is open, launches it if it doesn't, and then closes itself. The small program could be launched from Windows Scheduler every 15 minutes or so. 3) Other. #1 would be ideal. Anyone know of anything like that? I figure there mustbe something like this, given the need to run processes continually. #2 would be fine. But, while I know I can check if Access is running by using GetObject, I don't know how I would then check to see if that specific database is open (or if there are multiple instances of Access running). Any ideas? Thanks, Neil |
#5
| |||
| |||
|
| "Neil" <neil.ginsberg+newsgroup (AT) gmail (DOT) com> wrote in message news:jpet2i$bme$1 (AT) dont-email (DOT) me... I need to run a process using a timer. The process needs to be running all day long. We are looking for a way to ensure that the program is running, and, if not, then relaunch it. Some thoughts I had were: 1) Find a utility that runs in the background and checks periodically if the db is running, and, if not, relaunches it. 2) Write some code in Access VBA or in VB that checks to see if the database is open, launches it if it doesn't, and then closes itself. The small program could be launched from Windows Scheduler every 15 minutes or so. 3) Other. #1 would be ideal. Anyone know of anything like that? I figure there must be something like this, given the need to run processes continually. #2 would be fine. But, while I know I can check if Access is running by using GetObject, I don't know how I would then check to see if that specific database is open (or if there are multiple instances of Access running). Any ideas? Thanks, Neil If you are OK with Windows Scheduler, have it open you Access program and have Access exit when done. |
#6
| |||
| |||
|
|
I need to run a process using a timer. The process needs to be running all day long. We are looking for a way to ensure that the program is running, and, if not, then relaunch it. Some thoughts I had were: 1) Find a utility that runs in the background and checks periodically if the db is running, and, if not, relaunches it. 2) Write some code in Access VBA or in VB that checks to see if the database is open, launches it if it doesn't, and then closes itself. The small program could be launched from Windows Scheduler every 15 minutes or so. 3) Other. #1 would be ideal. Anyone know of anything like that? I figure there must be something like this, given the need to run processes continually. #2 would be fine. But, while I know I can check if Access is running by using GetObject, I don't know how I would then check to see if that specific database is open (or if there are multiple instances of Access running). Any ideas? Thanks, Neil |
#7
| |||
| |||
|
|
"Ron Paii" <None (AT) none (DOT) com> wrote in message news:jpfvdn$h1a$1 (AT) dont-email (DOT) me... "Neil" <neil.ginsberg+newsgroup (AT) gmail (DOT) com> wrote in message news:jpet2i$bme$1 (AT) dont-email (DOT) me... I need to run a process using a timer. The process needs to be running all day long. We are looking for a way to ensure that the program is running, and, if not, then relaunch it. Some thoughts I had were: 1) Find a utility that runs in the background and checks periodically if the db is running, and, if not, relaunches it. 2) Write some code in Access VBA or in VB that checks to see if the database is open, launches it if it doesn't, and then closes itself. The small program could be launched from Windows Scheduler every 15 minutes or so. 3) Other. #1 would be ideal. Anyone know of anything like that? I figure there must be something like this, given the need to run processes continually. #2 would be fine. But, while I know I can check if Access is running by using GetObject, I don't know how I would then check to see if that specific database is open (or if there are multiple instances of Access running). Any ideas? Thanks, Neil If you are OK with Windows Scheduler, have it open you Access program and have Access exit when done. Yes, that is the method we're currently using. Works fine. Only thing is, the process has to be run every 5 minutes on a continual cycle. So my concern was that continually opening and closing the Access database would, over time, exhaust system resources. My thought was that just keeping the db open and having it run on a timer loop would be better. But that would require some sort of method to guarantee that it was relaunched if it closed. |
#8
| |||
| |||
|
|
"Patrick Finucane" <patrickfinucan... (AT) gmail (DOT) com> wrote in message news:6e4e279a-ea38-4de0-ac8b-bb35dcb8d942 (AT) m8g2000yqo (DOT) googlegroups.com... On May 21, 9:18 pm, "Neil" <neil.ginsberg+newsgr... (AT) gmail (DOT) com> wrote: I need to run a process using a timer. The process needs to be running all day long. We are looking for a way to ensure that the program is running, and, if not, then relaunch it. Some thoughts I had were: 1) Find a utility that runs in the background and checks periodically if the db is running, and, if not, relaunches it. 2) Write some code in Access VBA or in VB that checks to see if the database is open, launches it if it doesn't, and then closes itself. The small program could be launched from Windows Scheduler every 15 minutes or so.. 3) Other. #1 would be ideal. Anyone know of anything like that? I figure there must be something like this, given the need to run processes continually. #2 would be fine. But, while I know I can check if Access is running by using GetObject, I don't know how I would then check to see if that specific database is open (or if there are multiple instances of Access running).. Any ideas? Thanks, Neil If I open the front end, I'll see an laccdb file created. *If I open a linked table, an laccdb file will be created for the backend. *When I close the table, the laccdb file closes in the backend, the front end still remains. *That is one method. *To check for an laccdb. *If it does not exist, launch. * However, the app could have closed abnormally the laccdb file could still remain, *With the OpenCurrent database you could set the exclusive flag to *True. *If no error, reopen. *#2 is a good option I think if you want to roll your own. . =================== I like that idea of opening with exclusive access and checking for an error. But, thinking it over, I'm not sure much would be accomplished by openingan Access app to check if the other Access app is running, as opposed to just launching and exiting the main Access app at set intervals through Windows Scheduler (see my last post in this thread to Ron). I suppose I could write the checking app as a VB app, which might be much smaller and might use fewer resources. Seem I'm chasing my tail here either way by opening a second app to checkif the first app is running.- Hide quoted text - - Show quoted text - |
#9
| |||
| |||
|
| "Neil" <neil.ginsberg+newsgroup (AT) gmail (DOT) com> wrote in message news:jpidld$fl3$1 (AT) dont-email (DOT) me... "Ron Paii" <None (AT) none (DOT) com> wrote in message news:jpfvdn$h1a$1 (AT) dont-email (DOT) me... "Neil" <neil.ginsberg+newsgroup (AT) gmail (DOT) com> wrote in message news:jpet2i$bme$1 (AT) dont-email (DOT) me... I need to run a process using a timer. The process needs to be running all day long. We are looking for a way to ensure that the program is running, and, if not, then relaunch it. Some thoughts I had were: 1) Find a utility that runs in the background and checks periodically if the db is running, and, if not, relaunches it. 2) Write some code in Access VBA or in VB that checks to see if the database is open, launches it if it doesn't, and then closes itself. The small program could be launched from Windows Scheduler every 15 minutes or so. 3) Other. #1 would be ideal. Anyone know of anything like that? I figure there must be something like this, given the need to run processes continually. #2 would be fine. But, while I know I can check if Access is running by using GetObject, I don't know how I would then check to see if that specific database is open (or if there are multiple instances of Access running). Any ideas? Thanks, Neil If you are OK with Windows Scheduler, have it open you Access program and have Access exit when done. Yes, that is the method we're currently using. Works fine. Only thing is, the process has to be run every 5 minutes on a continual cycle. So my concern was that continually opening and closing the Access database would, over time, exhaust system resources. My thought was that just keeping the db open and having it run on a timer loop would be better. But that would require some sort of method to guarantee that it was relaunched if it closed. I don't know the API calls, but you could have Access write it's PID to a text file when started, then delete the file when exiting. Have a VBA, VBscript, dotNet program check if the program with this PID is running. |
#10
| |||
| |||
|
|
On 23/05/2012 13:07:32, "Ron Paii" wrote: "Neil" <neil.ginsberg+newsgroup (AT) gmail (DOT) com> wrote in message news:jpidld$fl3$1 (AT) dont-email (DOT) me... "Ron Paii" <None (AT) none (DOT) com> wrote in message news:jpfvdn$h1a$1 (AT) dont-email (DOT) me... "Neil" <neil.ginsberg+newsgroup (AT) gmail (DOT) com> wrote in message news:jpet2i$bme$1 (AT) dont-email (DOT) me... I need to run a process using a timer. The process needs to be running all day long. We are looking for a way to ensure that the program is running, and, if not, then relaunch it. Some thoughts I had were: 1) Find a utility that runs in the background and checks periodically if the db is running, and, if not, relaunches it. 2) Write some code in Access VBA or in VB that checks to see if the database is open, launches it if it doesn't, and then closes itself. The small program could be launched from Windows Scheduler every 15 minutes or so. 3) Other. #1 would be ideal. Anyone know of anything like that? I figure there must be something like this, given the need to run processes continually. #2 would be fine. But, while I know I can check if Access is running by using GetObject, I don't know how I would then check to see if that specific database is open (or if there are multiple instances of Access running). Any ideas? Thanks, Neil If you are OK with Windows Scheduler, have it open you Access program and have Access exit when done. Yes, that is the method we're currently using. Works fine. Only thing is, the process has to be run every 5 minutes on a continual cycle. So my concern was that continually opening and closing the Access database would, over time, exhaust system resources. My thought was that just keeping the db open and having it run on a timer loop would be better. But that would require some sort of method to guarantee that it was relaunched if it closed. I don't know the API calls, but you could have Access write it's PID to a text file when started, then delete the file when exiting. Have a VBA, VBscript, dotNet program check if the program with this PID is running. Private Declare Function apiGetComputerName Lib "kernel32" Alias _ "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long Function GetPID() As Long GetPID = GetCurrentProcessId End Function Function fOSMachineName() As String 'Returns the computername Dim lngLen As Long, lngX As Long Dim strCompName As String lngLen = 16 strCompName = String$(lngLen, 0) lngX = apiGetComputerName(strCompName, lngLen) If lngX <> 0 Then fOSMachineName = Left$(strCompName, lngLen) Else fOSMachineName = "" End If End Function Might help, but if Access crashes, the text file will still have the PID. Might it be worth considering writing a date/ time to a text file, and somehow checking that it isn't more tham 5 minutes out of date? Phil |
![]() |
| Thread Tools | |
| Display Modes | |
| |