Solved

Checking MS Access instance ??

Posted on 1999-01-10
6
127 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
[X]
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
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
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!

 
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

Technology Partners: 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!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Suggested Courses
Course of the Month4 days, 2 hours left to enroll

630 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