Solved

Open and display an Access 2000 Database

Posted on 2003-12-10
4
163 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

820 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