Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Reg: Export Excel 2003 To Sql server 2005

Author  Topic 

ktpsubburaj
Starting Member

2 Posts

Posted - 2008-03-31 : 15:37:27
I want to export Excell 2003 to Sql Server 2005. I am having the following error while execute the query.


declare @SQL varchar(8000)
create table #temp(i int identity(1,1),SiteName varchar(100),SiteDescription varchar(5000),SiteURL varchar(500),CategoryName varchar(200))
set @SQL='Insert into #temp Select * From OPENROWSET (''Microsoft.Jet.OLEDB.4.0'',''Excel 8.0;Database=' +
'a.xls' +';HDR = YES;IMEX=0'',''SELECT * FROM [Sheet1$]'')'

exec (@SQL)



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.
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".

I need a solution urgently. help Pls

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-03-31 : 23:37:36
Where is excel file?
Go to Top of Page

ktpsubburaj
Starting Member

2 Posts

Posted - 2008-04-01 : 10:45:56
'a.xls' is the filename and it is stored in my local machine folder.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-04-02 : 05:33:28
quote:
Originally posted by ktpsubburaj

'a.xls' is the filename and it is stored in my local machine folder.


It should be in Server's Directory
For more informations, read this http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -