ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   connecting to sql database from excel using file dsn (https://www.excelbanter.com/excel-programming/383021-connecting-sql-database-excel-using-file-dsn.html)

Nate Fisher

connecting to sql database from excel using file dsn
 
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....



All times are GMT +1. The time now is 11:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com