Bob Bob - 23 hours ago 4
SQL Question

Excel Cells to ADODB.Recordset

I have an Excel spreadsheet that I want to make into an

ADODB.Recordset
. I've done this with an Excel table before, but not just cells. The
Fields
are in row 4 while the
Values
are in row 5. Everything before and after that is just visual garbage such as Title etc.

Normally I would just do something like
getSomething = MyADO.executeQuery("SELECT * FROM [Worksheet$]")
, but I'm lost on what to do here and how to test that it works.

Answer

This works for me (testing with ADO in Excel VBA tho...)

getSomething = MyADO.executeQuery("SELECT * FROM [Worksheet$4:5]")
Comments