help,
i have 2 database's in each is a table and i need to connect to both with a join and run some sql.
i have the following that connects to each DB but i cant work out how to get it to run the sql.
i have 2 database's in each is a table and i need to connect to both with a join and run some sql.
i have the following that connects to each DB but i cant work out how to get it to run the sql.
Code:
Dim dbe As PrivDBEngine
Dim wrk As Workspace
Dim dbs As Database
Dim dbs2 As Database
Set dbe = New PrivDBEngine
dbe.SystemDB = "c:\wrkgrp.mdw"
dbe.DefaultUser = "***"
dbe.DefaultPassword = "***"
Set wrk = dbe.Workspaces(0)
Set dbs = wrk.OpenDatabase("C:\Main.mdb")
Set dbs2 = wrk.OpenDatabase("c:\Info.mdb")
arcsql = "SELECT tbAssetInfo.* INTO tbAssetInfo IN 'C:\Arc.mdb' "
arcsql = arcsql & "FROM tblErrorInfo INNER JOIN tbAssetInfo ON tblErrorInfo.Uber = tbAssetInfo.Uber "
arcsql = arcsql & "WHERE (((tblErrorInfo.Status)=121));"
wrk.Execute arcsql