Opening A Database

N

Nedan Nedzatra

Hia!

Friends! How are you! Microsoft has saved you on Sat, Sun and most of the
Monday. I could not post any questions!

Anyway I have been struggling with something else and am no where near to
solve it!!!

Please see the below given codes; they create database in the workspace.
However I am not able to bring it to the user interface programmatically!!!


Sub WorkingWithSecondDatabase()

Dim wrkAcc As Workspace
Dim dbsNorthwind As Database

Set wrkAcc = CreateWorkspace("", "admin", "", dbUseJet)

Set dbsNorthwind = wrkAcc.OpenDatabase("NewDB.mdb", _
True)

'''''now how to bring NewDB.mdb onto the screen???

End Sub

Actually I can work with a database which is not open. However I am not able
to bring it the interface with codes ??? and I do not understand why we need
the workspace object when we can manipulate it when it is closed???
 
T

Tom van Stiphout

On Mon, 11 Jan 2010 14:33:01 -0800, Nedan Nedzatra

I changed your code to:
Application.CloseCurrentDatabase
Application.OpenCurrentDatabase "c:\test.mdb", False

-Tom.
Microsoft Access MVP
 
N

Nedan Nedzatra

Hia!

Van Stphout!

I got the idea from the codes and have managed to open a second database on
the screen createapplication method and visibility property.

However still I do not understand the following;

In your codes you close the currentdatabase first so the lines after that
are not going to be executed; I mean (Application.OpenCurrentDatabase
"c:\test.mdb", False).

Second though not directly related what is the purpose of workspace object?
Once you have a database open (or even not) you can work on databases you
want; I mean through SQL, DAO or ADO.

Many Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top