jadams0173
Technical User
- Feb 18, 2005
- 1,210
I'm trying to use Openrowset to access and A2K table. I've read the BOL on saw the examples that it showed. The question I have is that the BOL example using JET with access showed how to do it using the workgroup file with Admin login and '' password.
My Access DB has a database password when you open it. Is there a way to use openrowset with mdb file that is secured this way? I tried some methods of a connection string like would be used from VB6 but that didn't work.
BOL example:
What I've tried:
and the error is
Server: Msg 170, Level 15, State 1, Line 10
Line 10: Incorrect syntax near 'Jet OLEDB
atabase Password=mypw'.
My Access DB has a database password when you open it. Is there a way to use openrowset with mdb file that is secured this way? I tried some methods of a connection string like would be used from VB6 but that didn't work.
BOL example:
Code:
USE pubs
GO
SELECT a.*
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'c:\MSOffice\Access\Samples\northwind.mdb';'admin';'mypwd', Orders)
AS a
GO
What I've tried:
Code:
SELECT top 10 *
FROM
OPENROWSET(
'Microsoft.Jet.OLEDB.4.0',
'R:\Maintenance\DB_BE\stencils_master_be.mdb';
'Jet OLEDB:Database Password=mypw'
and the error is
Server: Msg 170, Level 15, State 1, Line 10
Line 10: Incorrect syntax near 'Jet OLEDB