Checking MS Access instance ??

Posted on 1999-01-10
Last Modified: 2010-05-03
Hi !
May I know how to check whether any MS Access in running background on Win95 as well as winnt using WINAPI ??
I'd tried using "Findwindow" but it always return 0.
Any idea ??
Question by:Rukawa
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Expert Comment

ID: 1455279
for 50 points try this code:

Option Explicit

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As Long) As Long

Private Sub Command1_Click()

    If FindWindow("OMain", 0) Then
        MsgBox "Access is running"
        MsgBox "Access is not running"
    End If

End Sub


Author Comment

ID: 1455280
Hi !
Thanks for you answer, I'd actually tried out above code on my machine(win95) as well as nt workstation 4.0.
It doesn't work. The findwindow API always return me "0".
I'd tried out on MSVC++ as well and its works to detect MSAccess.


Author Comment

ID: 1455281
Hi !
Thanks for you answer, I'd actually tried out above code on my machine(win95) as well as nt workstation 4.0.
It doesn't work. The findwindow API always return me "0".

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Accepted Solution

Sendoh earned 50 total points
ID: 1455282
Rukawa :
Try compile this working MSVC++ functions as another DLL and it should work. I'd experienced this before !! ^_^

Expert Comment

ID: 1455283
I hope you have try my proposed code (with the custom "declare").

It works fine for me (win95 / vb6)


Author Comment

ID: 1455284
Hi chabaud.
I did tried (Win95/VB5.0). But don't know what are the reason its doesn't work.
Since this is urgent to me and Sendoh's answer works. So I'd decide to give him/her the points !!

Thanks for you answer anyway !!

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VBA: Select SQL query based on a config Sheet v2 11 55
How to Add / Edit Windows Menu 4 80
Spell Check in VB6 13 148
Count text color with conditional formating in Excel 4 67
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question