connecting to sql database from excel using file dsn

N

Nate Fisher

in the past I have set up a machine dsn using Access then used the following
connection statements in excel vba to access the data.

Set wrkODBC = CreateWorkspace("", "admin", "", dbUseODBC)
Set Connection1 = wrkODBC.OpenConnection("Connection1",
dbDriverNoPrompt, , "ODBC;Uid=username;Pwd=password;DSN=dsnname")

it always worked great. Now I want to use a file dsn so any user can use
the excel file on a server that everyone has access to. I set up the file
dsn on the server at X:\foldername\dsnfilename.dsn . I'm wondering how I
have to alter my code to use this file dsn.... thanks in advance....
 

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