2009年10月29日 星期四

Excel openrowset 奇怪的問題

在某台機器上,利用openrowset讀取Excel出現以下錯誤, sql server 2005上surface area configuration的ad hoc remote query也啟用了,但就是不work...
重裝service pack後問題就解決, 但只要重新開機, 問題又來了,而且只有某台機器才會這樣,奇怪奇怪真奇怪...

已获得 OLE DB 记录。源:“Microsoft SQL Native Client” Hresult: 0x80040E14 说明:“无法初始化链接服务器 "(null)" 的 OLE DB 访问接口 "Microsoft.Jet.OLEDB.4.0" 的数据源对象。”。
已获得 OLE DB 记录。源:“Microsoft SQL Native Client” Hresult: 0x80040E14 说明:“链接服务器"(null)"的 OLE DB 访问接口 "Microsoft.Jet.OLEDB.4.0" 返回了消息 "未指定的错误"。”。

An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E14 Description: "Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".".
An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E14 Description: "The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.".

最後找到方法, 設定 registry key,
HKLM\SOFTWARE\Microsoft\Microsoft Sql Server\\Providers\Microsoft.Jet.OLEDB.4.0
AdHocAccess = 0

原文參考 Jet.OLEDB.4.0 and Linked Servers
Check Disallow AdHoc Access, this will create the right key with the wrong value (1 instead of the correct 0). Unchecking this option will remove the key and the value, this is interpreted as 'value = 1'. This 'Removing' in combination with the standard-value 1 (if no key exists) is the bug.
Close the Sql-Management-Studio, open RegEdit and search for the specific key. If you have more than one instance, use the right internal name (MSSQL.1 / MSSQL.2 etc.).
Change the value to 0
Restart your MS-SqlServer. Using Reconfigure doesn't help.


1 則留言:

pdf.js 無法顯示部份字

有個檔案在pdf viewer套件中無法顯示內容,但下載檔案後使用工具又可以正常顯示。 本來以為是套件版本太舊的原因,於是去下載pdf viewer套件 https://github.com/mozilla/pdf.js 更新後還是一樣。 覺得應是字型缺漏的問題,於是用PDF-X...