level 2
       
      
	
	
	  用sql语句将excel导入到数据库中为啥有的时候第一行是空的,有的时候不是呢,求解啊
	
	2012年12月16日 13点12分
	1
	
       
     
    
    
      
	
	
	level 2
       
      
	
	
	  还有一个问题:
--1、建表:
Create table items_ordered
(
customerid varchar(20)not null,
order_date date not null,
Item varchar(20)not null,
quantity int not null,
price money not null
)
--2:打开外围应用配置
EXEC sp_configure 'show advanced options', 1
GO RECONFIGURE
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', 1
GO
RECONFIGURE
GO
--3、导入excel
Use sag
insert into items_ordered select *from
OPENROWSET('MICROSOFT.JET.OLEDB.4.0',
'Excel 5.0;HDR=NO;DATABASE=F:\NIIT\items_ordered.xls',Sheet1$)
这时候就出错了.报错如下:
消息 7399,级别 16,状态 1,第 2 行
链接服务器 "(null)" 的 OLE DB 访问接口 "MICROSOFT.JET.OLEDB.4.0" 报错。提供程序未给出有关错误的任何信息。
消息 7303,级别 16,状态 1,第 2 行
无法初始化链接服务器 "(null)" 的 OLE DB 访问接口 "MICROSOFT.JET.OLEDB.4.0" 的数据源对象。
求解啊,哪位大神来救救我啊
	
	2012年12月16日 14点12分
	4