Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Error while importing to excel Expand / Collapse
Author
Message
Posted Friday, August 16, 2013 11:33 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, February 5, 2015 10:30 PM
Points: 137, Visits: 266
Hi,
I am trying to import sample data into excel,using following code,but it gives me following error,


Create Table Test
(
a Varchar(2),
b Varchar(2)
)

Insert Into test
values ('ab','bc')


insert into
openrowset('microsoft.ace.oledb.12.0',
'excel 12.0; database= D:\test' ,
'SELECT * FROM [Sheet1$]'
)select * from test




Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "microsoft.ace.oledb.12.0" for linked server "(null)" reported an error. The provider did not give any information about the error.

Msg 7303, Level 16, State 1, Line 2
Cannot initialize the data source object of OLE DB provider "microsoft.ace.oledb.12.0" for linked server "(null)".
Post #1485437
Posted Monday, August 19, 2013 6:39 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, February 26, 2015 7:25 AM
Points: 1,049, Visits: 3,158
avdhut.k (8/16/2013)
Hi,
I am trying to import sample data into excel,using following code,but it gives me following error,


Create Table Test
(
a Varchar(2),
b Varchar(2)
)

Insert Into test
values ('ab','bc')


insert into
openrowset('microsoft.ace.oledb.12.0',
'excel 12.0; database= D:\test' ,
'SELECT * FROM [Sheet1$]'
)select * from test




Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "microsoft.ace.oledb.12.0" for linked server "(null)" reported an error. The provider did not give any information about the error.

Msg 7303, Level 16, State 1, Line 2
Cannot initialize the data source object of OLE DB provider "microsoft.ace.oledb.12.0" for linked server "(null)".

You need to specify an excel file.

You currently only have
database= D:\test





The SQL Guy @ blogspot

@SeanPearceSQL

About Me
Post #1485767
Posted Monday, August 19, 2013 11:30 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Friday, January 30, 2015 11:07 AM
Points: 4,155, Visits: 7,186
This is a duplicate post
http://www.sqlservercentral.com/Forums/Topic1485438-391-1.aspx


______________________________________________________________________________
"Never argue with an idiot; They'll drag you down to their level and beat you with experience"
Post #1485920
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse