2012年12月26日 星期三

OPENROWSET open Access Database

參考引用:
---
SELECT top 10 *
FROM
OPENROWSET(
    'Microsoft.Jet.OLEDB.4.0',
    'C:Testdata est.mdb';
    'admin';'',Table1)

---
回答區:

This works (ODBC):


select *
  from openrowset('MSDASQL',
                             'Driver={Microsoft Access Driver (*.mdb)};Dbq=C:MBK.mdb;SystemDB=C:SECURED.MDW;Uid=me;Pwd=pw;',
                             'select * from [Mbk]')

This works (Jet.OLEDB):

select *
  from opendatasource('Microsoft.Jet.OLEDB.4.0',
  'Data Source=C:MBK.mdb;Jet OLEDBystem Database=C:SECURED.MDW;User ID=me;Password=pw;')
  ...Mbk

This won't work (Jet.OLEDB):

select *
  from openrowset('Microsoft.Jet.OLEDB.4.0',
                  'MS Access;Database=C:MBK.mdb;System Database=C:SECURED.MDW;UID=me;PWD=pw;',
                  'select * from [Mbk]')

saying ... "Wrong argument".

This won't work (Jet.OLEDB):

select *
  from openrowset('Microsoft.Jet.OLEDB.4.0',
                  'MS Access;Database=C:MBK.mdb;SystemDB=C:SECURED.MDW;UID=me;PWD=pw;',
                  'select * from [Mbk]')

沒有留言:

張貼留言