Solved

Open and display an Access 2000 Database

Posted on 2003-12-10
4
161 Views
Last Modified: 2010-05-03
The Following is my code for this event:

Private Sub cmdOpenDatabase_Click()
Dim x As Object

On Error Resume Next
Set x = GetObject("G:\Common\AnnuityGeneralServices\DailyVarianceSystem\Variance.mdb")
If x Is Nothing Then
  'if you get here, the database is not available or Access is not installed!
 
Else
  x.Visible = True
End If

End Sub

When it executes you can see the Splash screen for the database flash for just a fraction of a second and then it closes the Database.  Can you help?
0
Comment
Question by:dick3677
4 Comments
 
LVL 24

Accepted Solution

by:
shivsa earned 250 total points
ID: 9913997
0
 
LVL 28

Assisted Solution

by:vinnyd79
vinnyd79 earned 250 total points
ID: 9914964
Have you tried ShellExecute API:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Sub Command1_Click()
Call ShellExecute(hwnd, "Open", ("C:\Test.mdb"), "", App.Path, 1)
End Sub
0
 
LVL 27

Expert Comment

by:planocz
ID: 10260718
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
No response from dick3677 from 12/10/2003 comment
Award points to shivsa(50%) and vinnyd79(50%) is recommend.
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

planocz
EE Cleanup Volunteer
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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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.
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…
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…

920 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

16 Experts available now in Live!

Get 1:1 Help Now