Is another instance of Access running

  • Thread starter Thread starter Dale Fye
  • Start date Start date
D

Dale Fye

I need to perform a number of sequential steps in Access. Each of these
steps involves a running a separate Access application, which has been setup
to run unattended. I started thinking that I would just code the Close
event of each applications main form to kick off the next application, but
realized that the series of applications is likely to change occassionally.

To over come this, I was thinking was about starting this all off with an
Access application that would shell out to each of the sequential steps, and
then, when one step finishes, move onto the next step. Only problem is, I
have not been able to figure out how to tell if another instance of Access
is running.

Any ideas or alternative suggestions would be greatly appreciated.

Dale
 
Arvin,

I guess that is 75% of the solution. Is there a way to tell what the the
file name is if the application is open and has a file open?

Thanks
 
I'm sure there is, because the OS keeps track of all open files. I'd go abut
it differently, though. Since I would never care about most files being
open, it stands to reason that there are only a few that can affect the way
my Access application works. For those, assuming that it is an Access file,
I can test for specific files. For instance, if I want to check if
Northwind.mdb is open, all I need to do is check for Northwind.ldb in the
same directory.

Public Function FileExists(strFile As String) As Boolean
On Error Resume Next
Dim intFileLength As Integer

intFileLength = FileLen(strFile)

If Err = 53 Then
FileExists = False
Else
FileExists = True
End If

End Function
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Great idea.

Thanks, Arvin.

Dale

Arvin Meyer said:
I'm sure there is, because the OS keeps track of all open files. I'd go
abut
it differently, though. Since I would never care about most files being
open, it stands to reason that there are only a few that can affect the
way
my Access application works. For those, assuming that it is an Access
file,
I can test for specific files. For instance, if I want to check if
Northwind.mdb is open, all I need to do is check for Northwind.ldb in the
same directory.

Public Function FileExists(strFile As String) As Boolean
On Error Resume Next
Dim intFileLength As Integer

intFileLength = FileLen(strFile)

If Err = 53 Then
FileExists = False
Else
FileExists = True
End If

End Function
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top