Link to home
Start Free TrialLog in
Avatar of zhshqzyc
zhshqzyc

asked on

Connect a mdb file.

Hello, I used SQL Server one years ago. Now I almaost forget everything. I have a file C:\BAND\player.mdb. How can I connect it by SQL Server 2008 R2?
Suppose SQL Server Authentication is used.

Thanks.
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

a mdb file is an Access file not a SQL Server

but you can use OpenRowset as shown in http://msdn.microsoft.com/en-us/library/ms190312.aspx

SELECT *
   FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
      'C:\BAND\player.mdb';
      'admin';'',Customers);
GO
Avatar of zhshqzyc
zhshqzyc

ASKER

I meant to connect it from SQL Server Management Studio.
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Okay. If it is a mdf file, can I do it?
if its from sql 2005 yes , sql 2000 probably

sql 7 or earlier probably not...

do you know which version created it?

go into management studio right click databases and try attach database...
Yes, then you can attach to it..

I followed a book by APRESS, the author use an example by SQL Server 2005 connect a mdb file on management Studio.
However SQL Server 2005 is a legacy technology. You know, the popular is 2008.
Then the question was arised.