Error 80040e21... rs.Open "SELECT ...

Dim cn As ADODB.Connection
dim rs As ADODB.Recordset

Set cn = New ADODB.Connection
    cn.Open "DRIVER={Microsoft Excel Driver (*.xls)};DriverId=790;ReadOnly=True;" & "DBQ=" & "c:\book1.xls" & ";"
Set rs = New ADODB.Recordset

'****   Following line errors:  ODBC driver does not support the requested properties*****

    rs.Open "SELECT * FROM [SHEET1]", cn, adOpenForwardOnly, adLockReadOnly, adCmdText
    While Not rs.EOF
        MsgBox rs(0)
    rs.MoveNext
    Wend
    rs.Close
Set rs = Nothing
    cn.Close
Set cn = Nothing

Why am I getting this error?
LVL 34
Mike EghtebasDatabase and Application DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike EghtebasDatabase and Application DeveloperAuthor Commented:
Well, $ was missing from worksheet name.  I didn't think it is mandatory to have it there.

Mike
0
aelatikCommented:
You can find more info here on select statements for Excel sheets like selecting within CELL range's etc.

http://support.microsoft.com/kb/257819/EN-US/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
EgoreCommented:
You may want to look at this newsgroup thread (particularly the last two posts):

http://groups.google.com/groups?hl=en&lr=&safe=off&th=7f28c50074fcaeb2&seekm=3d65a4c9%241%40dnews.tpgi.com.au&frame=off

I'm not certain if that URL is permanent, but hopefully it is...
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Mikal613Commented:
rs.Open "SELECT * FROM [SHEET1]", cn, 3, 2

TRy this instead
0
Mikal613Commented:
rs.Open "SELECT * FROM [SHEET1$]", cn, 3, 2

I mean this sorry!
0
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.