Opening Excel sheet via ODBC

Z

Zawinulfans

Hello everybody,
I'm trying to open an Excel file using ODBC with DAO.
I already know how to open it without ODBC, but at this moment I need
to use ODBC.

Dim wrkodbc As DAO.Workspace
Dim mycon As DAO.Connection
Dim rst As DAO.Recordset


Set wrkodbc = CreateWorkspace("mywks", "admin", "", dbUseODBC)

Set mycon = wrkodbc.OpenConnection("conn1", dbDriverNoPrompt, ,
"ODBC;DSN=test;")

Set rst = mycon.OpenRecordset("Foglio1$")

With this code I get a 3146 runtime error.

Could you help me in some way?

Many thanks in advance,
all the best.

Marco (Italy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top