如题。
我是这么写的:Insert into test(ID,NAME,DEPT,CLASSID)
SELECT ID,NAME,DEPT,CLASSID FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source="D:\book2.xls";User ID=admin;Password=;Extended properties=Excel 5.0')...Sheet1$
执行后提示:
消息 7314,级别 16,状态 1,第 1 行
链接服务器 "(null)" 的 OLE DB 访问接口 "Microsoft.Jet.OLEDB.4.0" 不包含表 "Sheet1$"。该表不存在,或者当前用户没有访问该表的权限。
这是在SQL 2005中执行提示的,同样的语句在SQL2000中执行成功。
我是这么写的:Insert into test(ID,NAME,DEPT,CLASSID)
SELECT ID,NAME,DEPT,CLASSID FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source="D:\book2.xls";User ID=admin;Password=;Extended properties=Excel 5.0')...Sheet1$
执行后提示:
消息 7314,级别 16,状态 1,第 1 行
链接服务器 "(null)" 的 OLE DB 访问接口 "Microsoft.Jet.OLEDB.4.0" 不包含表 "Sheet1$"。该表不存在,或者当前用户没有访问该表的权限。
这是在SQL 2005中执行提示的,同样的语句在SQL2000中执行成功。
有链接吗?有权限没?
FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0',
'Data Source="c:\test.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...xactions]
参考
没试过呢
以前的问题是这个
The OLE DB provider "MICROSOFT.JET.OLEDB.4.0" for linked server "(null)" does not contain the table "sheet1$". The table either does not exist or the current user does not have permissions on that table.
消息 7314,级别 16,状态 1,第 1 行
链接服务器 "(null)" 的 OLE DB 访问接口 "Microsoft.Jet.OLEDB.4.0" 不包含表 "Sheet1$"。该表不存在,或者当前用户没有访问该表的权限。