SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Script Library
 OPENROWSET and EXCEL
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

philkos
Starting Member

Kuwait
5 Posts

Posted - 11/07/2006 :  08:23:42  Show Profile  Reply with Quote
I having an excel file called TEST.XLS (in c:\ drive) which has 3 columns (c0,c1,c2) & 8 rows
c0 c1 c2
1 a A
2 b B
3 c C
4 d D
5 e E
6 f F
7 g G
8 h H

In sql server i have one table called TEST which has three columns
c0 char(10)
c1 char(10)
c2 char(10)


when i runnig the following query

select *
into TEST from openrowset('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\TEST.xls;HDR=YES',
'select * from [Sheet1$]')



i am getting error like this

Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error.
[OLE/DB provider returned message: The Microsoft Jet database engine could not find the object 'Sheet1$'. Make sure the object exists and that you spell its name and the path name correctly.]
OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IColumnsInfo::GetColumnsInfo returned 0x80004005: ].

Version : Sql server 2000 & Excel 2002

Anybody having any idea why this error occuring?
thanks in advance...
Philkos

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 11/07/2006 :  08:38:21  Show Profile  Reply with Quote
The script Library is for posting working scripts, not for questions.

You should post your question on the Developer Forum.



CODO ERGO SUM

Edited by - Michael Valentine Jones on 11/07/2006 08:38:43
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22761 Posts

Posted - 11/16/2006 :  03:39:04  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926&whichpage=10

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000