Solved

Open and display an Access 2000 Database

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
VBA to format 3 80
Help in WHSCRIPT 9 41
to transfer string from C lanaguage to VBA 4 44
VBA Shell can't Find Word document 11 45
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.
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…
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…

760 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