0

Can you perform a join on two tables, one is an Access database and the other is a SQL Server database.

I understand that I could perform a SELECT on each database, and then manually join the results. Is this how I'm going to have to do it?

I'm working in VB.net, using OleDBConnection stuff.

If it's possible (which I'm beginning to doubt), can you please provide sample code?

  • 1
    You can use [`sp_addlinkedserver`](http://msdn.microsoft.com/en-us/library/ms190479.aspx) to create linked servers. Then you can `join` both tables in a Stored-Procedure even if the one is in Access and the other is in SQL-Server. – Tim Schmelter Jun 05 '12 at 22:22

2 Answers2

1

I think you're looking for this. It's for VB.NET 3.0, but could still apply in some variation in higher versions: http://support.microsoft.com/kb/113701

If you're looking for a programmatic way to do it with VB.NET 4.5, using OleDBConnection and datasets: http://msdn.microsoft.com/en-us/library/bh8kx08z.aspx

0

You could try using Linq to SQL with 2 different data contexts - see this for an example

Community
  • 1
  • 1
Ando
  • 11,199
  • 2
  • 30
  • 46