Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening Excel table via ODBC

Status
Not open for further replies.

zawinulfans

Programmer
Apr 10, 2003
5
IT
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)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top