Open a database into a new visible Access instance

  • Thread starter stanko via AccessMonster.com
  • Start date
S

stanko via AccessMonster.com

Hi,

i have a question, i'd like to open from one db another one that is connected
to mdw file. Here is the code i'm using:

Function Open_db(sUserName, sPassword)

Dim dbs As Database
Dim dbe As PrivDBEngine, wks As Workspace

'------ Setup connection variables -------
'sUserName = "" uncomment if u want the hardcopy the variables
'sPassword = ""
dbpath = fGetPath("Select the database you want to relink")
If dbpath = "" Then
Exit Function
End If
strMdwPath = fGetPath("Select the MDW security file")
sDbPwd = ""
'------------

On Error GoTo Change_Err
Set dbe = New PrivDBEngine
With dbe
.SystemDB = strMdwPath
.DefaultUser = sUserName
.DefaultPassword = sPassword
Set wks = .Workspaces(0)
End With
Set dbe = wks.OpenDatabase(dbpath, False, False, ";PWD=" & sDbPwd)
.......


My question is how i can make the instance visible and open it like holding
SHIFT key down so the startup get passed by....


Thanks

Stan
 

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