How to open/launch a .mdb file from a VB6 app??

pgxysyd

New member
Local time
Today, 22:10
Joined
Sep 26, 2006
Messages
1
Hi Guys,

This may or may not be a simple question.........??

I have had a trawl through the www, but there seem to be many varying ways of doing this. Most of which I dont understand!!

What is the simplest (script) way of opening a .mdb file from a within a basic VB appliaction that I have made i.e by clicking a command button that says "Click this button to open XXX.mdb"

Any suggestions would be great :-)

Regards
Gavin
 
Well that all depends on what method you want to use to open it. There are many options such as ADO or DAO to create a connection to the database. Using DAO you would do the following.

Dim dbTest as DAO.Database
dim rsTest as DAO.Recordset

Set dbTest.OpenDatabase(<Database path and name>)
Set rsTest = dbTest.OpenRecordset("SELECT * FROM <Table Name>")

There are many other ways ADO is very popular. Once you have the DB open you would then need a recordset object for DAO. You then use this object to actually retrieve data from the database using the connection you have made to the database above.
 
If you're actually trying to start up the mdb for the user, you can use Shell.
 

Users who are viewing this thread

Back
Top Bottom