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: Friday, July 25, 2014 12:01 AM
Points: 132, Visits: 254
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


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 12:07 AM
Points: 868, Visits: 2,775
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


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 2:57 PM
Points: 3,893, Visits: 7,136
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