Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Is there a way to access data from MS Access?

Author  Topic 

cedartie
Starting Member

6 Posts

Posted - 2005-06-23 : 11:54:14
I'd like to create a stored procedure but much of the data I need is in an Access DB. Is there a way that I can open this data without having to DTS it into an Access table???

dsdeming

479 Posts

Posted - 2005-06-23 : 12:19:19
From OPENROWSET in BOL:

C. Use the Microsoft OLE DB Provider for Jet
This example accesses the orders table in the Microsoft Access Northwind database through the Microsoft OLE DB Provider for Jet.



Note This example assumes that Access is installed.


USE pubs
GO
SELECT a.*
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'c:\MSOffice\Access\Samples\northwind.mdb';'admin';'mypwd', Orders)
AS a
GO



Dennis
Go to Top of Page

cedartie
Starting Member

6 Posts

Posted - 2005-06-23 : 13:17:06
Get the following error..
Server: Msg 7415, Level 16, State 1, Line 1
Ad hoc access to OLE DB provider 'Microsoft.Jet.OLEDB.4.0' has been denied. You must access this provider through a linked server.
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2005-06-23 : 15:45:32
Set up a linked server relationship from your SQL Server to the MS-Abcess data. See BOL for details.

HTH

=================================================================
'Tis with our judgements as our watches: none Go just alike, yet each believes his own. -Alexander Pope, poet (1688-1744)
Go to Top of Page
   

- Advertisement -