Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 17th, 2005, 05:47 PM
Friend of Wrox
 
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to browse and load mdb file from access form

how to browse and load mdb file from access 2000 form?

Hi guys. I want to design an access 2000 application that does the following.Inside a form
I want to be able brosse my hard disk and select an access mdb file . once i selected the db and click on ok,i want to be able to work on that mdb as if i opend it diretly. I be happy if some one teach me how to
create such browse mdb functionality. you can see the picture below.Thanks

http://i5.photobucket.com/albums/y18...roserfordb.jpg (pic of browse mdb option)
 
Old June 18th, 2005, 09:52 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 248
Thanks: 0
Thanked 1 Time in 1 Post
Default

Just FYI. You are reinventing the wheel. There are plenty of lauchers available to do what you want.

How they work...

First you'll have to decide how you want to "browse your hard disk". Plenty of ways to do that. But you might want to check out the FileSystemObject for looking at "file system objects". This will give you a way to load file names to your form. There are also COM objects that you can use to pop up a file search dialog.

When you've chosen the method to provide the file name to the user, launching the database can be accomplished in several ways as well. How you do that will depend on how much control you want of the application that is launched from within the application that has the form that lists the files.

Check out the SHELL function for one possibility. Easy to launch your database but very difficult to control without using Windows API calls. That code can be as simple as:

Shell(your_file_name)

You could create your own instance of Access. This allows more control but you'll have to be careful not to destroy your instance of Access before the user is finished with the database. That code has some of this in it:

dim app as New Access.Application
app.OpenCurrentDatabase your_file_name
app.Visible = True
app.UserControl = True
' wait until the user is finished
set app = Nothing





Similar Threads
Thread Thread Starter Forum Replies Last Post
Access is denied" load a simple xml file nana XML 12 May 12th, 2010 07:01 AM
Creating Access (.mdb) file from ASP mfarooqw ASP.NET 2.0 Basics 1 June 5th, 2007 02:39 AM
Open mde or mdb access file from vb6 gorgo Pro VB 6 1 February 20th, 2006 01:39 AM
How to auto load(on start) a form in access 2000? method Access 1 June 17th, 2005 10:55 PM
Manage the .ldb file when ADO opens a Access .mdb marcelescu Visual C++ 1 October 18th, 2004 06:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.