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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a Query from a separate Database

Status
Not open for further replies.

CoffeeNow

Technical User
Oct 31, 2000
6
US
I would like to run a maketable query on a separate database by clicking a button on the current database. Is this possible, and if so, how?

Three points to make:
1) the separate database in which I want to run the maketable query is password protected.
2) I know the password
3)Access97
 
Assuming that the source data for the MakeTable query is also in the other database, here's what you do:
Code:
    Dim ws As Workspace, db As Database

    Set ws = DBEngine.CreateWorkspace("Temp", User, Password)
    Set db = ws.OpenDatabase(PathName)
    db.QueryDefs(MakeTableQueryName).Execute
    Set db = Nothing
    Set ws = Nothing
Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top