General discussion

Locked

Opening a connection in VB to Excel

By surftex ·
What is the best way to open a connection,and execute a SQL command on an excel spreadsheet?

I don't seem to have a problem opening the connection, but when I attempt to open a recordset using this connection : rsOpenACT.Open "Select * from Spreadsheet" I get an Error :"[Microsoft][ODBC Excel Driver]. The Microsoft Jet database engine could not find the object 'Spreadsheet'. Make sure the object exists and that you spell its name and the path name correctly."

I think all I really need is a sample Connection String, and a sample Recordset.Open method.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Opening a connection in VB to Excel

by jim.schromm In reply to Opening a connection in V ...

It would seem to me that your path or query is not defining the Sheet name within the Excel file to return. Each sheet acts as a table.

Collapse -

Opening a connection in VB to Excel

by Shanghai Sam In reply to Opening a connection in V ...

It's the specific syntax that I'm looking for. How do I define the Sheet name within the Excel file in the connection string?

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums