Open a recordset from excel with VB6

I need to get data from Excel to a recordset.
I found this code on the Internet, but I don't know what to do from here... How do I go from here to a recordset?  Is there a better way to do this?


oConn.Open "Driver={Microsoft Excel Driver (*.xls)};" & _
           "DriverId=790;" & _
           "Dbq=c:\somepath\mySpreadsheet.xls;" & _
           "DefaultDir=c:\somepath"

I plan to take this data and validate it and base on the validation, this data from excel will go into an access database if it passes the validation, while the errors will go into an error spreadsheet in Excel.  Although I worte the validation loop, I cannot use it because I don't know how many rows the spreadsheet has from where I get the data, each spreadsheet has a differnet number of rows.  I need to use a for loop for i=2 to rows.columns.count (this doesn't work either) so I thought I would use for i = 2 to recordset.EOF.  But I don't know how to get the recordset.  Can you please help me!!!
Angie
Angie532Asked:
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.

DhaestCommented:
SAMPLE: ExcelADO Demonstrates How to Use ADO to Read and Write Data in Excel Workbooks

http://support.microsoft.com/?id=278973
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
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.