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

Join with table from another database

Status
Not open for further replies.

guitarzan

Programmer
Apr 22, 2003
2,236
US
I have an ASP program, and am accessing data from an Access database; here's some basic code
Code:
Dim ConnLog, rsLog, vtmpsql

Set ConnLog = Server.CreateObject("ADODB.Connection")
ConnLog.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & _
	Server.MapPath("/") & "\..\data\log.mdb"

Set rsLog = Server.CreateObject("ADODB.Recordset")

vtmpsql = "SELECT Log.id, Log.logAction, Clients.cliName " & _
	" FROM Log LEFT JOIN Clients ON Log.ClientID = Clients.id"
	
rsLog.Open vtmpsql, ConnLog

...which would work fine, if the "Clients" table were in "log.mdb". Instead, the Clients table is in a different mdb file ("main.mdb"), and this table has a password set on it. How can I complete my join statement?
 
Can't you create a linked Clients table (with password remembered) in the log.mdb DB ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for the reply... yes that will definitely work. I am wondering, is there a way to do this via code, rather than modifying the mdb file?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top