Solved

Checking MS Access instance ??

Posted on 1999-01-10
6
122 Views
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 ??
0
Comment
Question by:Rukawa
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:chabaud
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"
    Else
        MsgBox "Access is not running"
    End If

End Sub

0
 

Author Comment

by:Rukawa
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.

0
 

Author Comment

by:Rukawa
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".

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Accepted Solution

by:
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 !! ^_^
0
 
LVL 4

Expert Comment

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

It works fine for me (win95 / vb6)

0
 

Author Comment

by:Rukawa
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 !!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA: Add rows to listbox based on criteria 7 73
How to debug this code 7 56
vb6 connector to mongodb 2 49
Looking for VB6 code to read SQL table export it to ascii 8 32
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now