Solved

Open and display an Access 2000 Database

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adding to a VBA? 6 69
SQL VB connection works in one PC and doesn't in another 15 64
MsgBox 4 59
VB6 - Scroll Mouse wheel on Picturebox 13 42
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 …
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.
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…
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…

808 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