Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open external database

Status
Not open for further replies.

xsnrg

Technical User
Jun 15, 2004
44
US
I am looking for the code that would open another access database in the background. Any leads?
 
You can use the OpenConnection method to open an ADO connection to an existing Microsoft Access project (.adp) or Access database (.mdb) as the current Access project or database in the Microsoft Access window.

expression.OpenConnection(BaseConnectionString, UserID, Password)

Try this
 
I tried that with this modification...
expression.OpenConnection ("d:\wwireless\sql-baseline.mdb")

There is no username or password so I left it like this but it didn't work. Any suggestions or corrections?

 
but it didn't work
Any error message ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I have used this code to open an Access Project.

Option Explicit
Public pubAppAccess As Access.Application, pubOldAccess As Access.Application
Public pubFilePath As String

' Open Access project.
pubFilePath = "C:\maindir\test\projects\remotepubs.adp"
Set pubAppAccess = New Access.Application
pubAppAccess.OpenAccessProject pubFilePath

pubAppAccess.Application.RefreshDatabaseWindow
pubAppAccess.Application.Visible = True

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top