SELECT * FROM OPENROWSET('sqloledb.1','mrp-server';'sa';'123',DBdata.dbo.tbG_gzzxzl)
SELECT a.*
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'd:/aaa.xls';'admin';'', data)
AS a
以下語句能成功,上一天語句卻不行:OLE DB 提供者 'Microsoft.Jet.OLEDB.4.0' 報錯。
[OLE/DB provider returned message: 不可識別的資料庫格式 'd:/aaa.xls'。]
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="d:/aaa.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...data$
SELECT *
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="c:/account.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...abc$ insert into OPENDATASOURCE('sqloledb','Data Source=mrp-server;User ID=sa;Password=12345').voutmmstdata.dbo.zcctest (cust_no,cust_name)
SELECT cust_no,cust_name
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0','Data Source="c:/111.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...getbom1$ select * from OPENDATASOURCE('SQLOLEDB', 'Data Source=mrp-server;User ID=sa;Password=12345').voutmmstdata.dbo.zcctest delete from opendatasource('sqloledb','Data Source=mrp-server;User ID=sa;Password=12345').voutmmstdata.dbo.zcctest
這條語句在ACCESS資料庫不帶密碼的時候也能成功運行,加上寄密碼之後按照以下寫法卻不行:其中abc密碼. SELECT a.*
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'd:/demo.dat';'admin';'abc', temp)
AS a