2
insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', 
'Excel 8.0;Database=D:\contact.xls;', 
'SELECT * FROM [$Sheet1]') 
select * from Persons

This code not working..It is giving the error

OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" 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.".
Msg 7350, Level 16, State 2, Line 2
Cannot get the column information from OLE DB provider "Microsoft.Jet.OLEDB.4.0" 
for linked server "(null)".

Please help

3
  • If i remove the '$' then also giving the same error..Please help anyone Commented Aug 2, 2011 at 11:32
  • then what should I write please tell me Commented Aug 2, 2011 at 11:37
  • Added an answer. Try "[Sheet1$]". Commented Aug 2, 2011 at 11:42

2 Answers 2

3

It turns out that The Microsoft Jet database engine could not find the object '$Sheet1', and so you should Make sure the object exists and that you spell its name and the path name correctly.

Sign up to request clarification or add additional context in comments.

2 Comments

No I have checked the object and sheet name
Is there a sheet called $Sheet1?
0

Excel sheet names

Identify the name of the sheet you are trying to "connect" to. Have a look at the picture above. The standard sheets are called "Sheet1" to "Sheet3". Your workbook under D:\contact.xls probably has custom names. Use the name you find there and add a $ to the end of it.

'SELECT * FROM [Sheet1$]'

5 Comments

Hi cularis..how will I find the custom names?can u please elaborate
There is even a picture in my answer! Just open contact.xls with excel and look at the buttom left corner.
Did you try putting the dollar at the end of Sheet1 and removing it from the front?
insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=D:\contact.xls;', 'SELECT * FROM [Sheet1$]') select * from Persons
Michelle: Click Start, Run. Enter d:\contact.xls, press Enter. Confirm there is a sheet called exactly Sheet1. Try the code above. Verify that the error message says EXACTLY the same as in your original question? As a developer you'll learn quickly that 'still not working' is THE most useless piece of information you can ever possibly conceive of giving.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.