How to make an OLE heterogeneous join between MS Access Db and Pervasive SQL 2000i Db
-
27-10-2019 - |
题
I would like to use an OleDbDataReader and a select statement similar to below:
I am using C# 4.0 and .NET 4.0: Database1 = MS access Database2 = Pervasive SQL 2000i
SELECT db1.Field1, db2.Field2
FROM Database1 db1
INNER JOIN Database2 db2
ON db1.key = db2.key
EDIT 1: If this helps...
Here is the Pervasive Connection String:
var constrP1 = "Provider=PervasiveOLEDB;Connect Timeout=60;Data Source=" + PervasiveDBName + ";";
Here is the MS Access Connection:
var conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sDataSource + ";User Id=admin;Password=");
解决方案
Ah, I just saw that this is MS-Access. Use a linked table from MS-Access to the Pervasive DB via ODBC. So open the MS-Access DB, create the linked table, [create a ODBC connection on your machine if one doesn't already exist], query the MS-Access Database which will do the heterogeneous magic for you.
不隶属于 StackOverflow