简体   繁体   中英

How to make an OLE heterogeneous join between MS Access Db and Pervasive SQL 2000i Db

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM