1

I have an Excel workbook with a Microsoft SQL Server connection. I want to be able to send this workbook with the connection so that others can use it, but they do not have SQL Server licenses.

Is there any way to include my authentication within the workbook so that the connection will still work?

Thanks!

2
  • What kind of database do you use? What do you mean with SQL licenses? Commented Dec 8, 2016 at 21:12
  • The company where I work uses Microsoft SQL Server, and we have a limited number of licenses. Each license costs money, so the company tries to limit which individuals get one. So if the company determines that an individual does not have a great enough need for a license, they are not given the credentials to access the database, so I am trying to bypass that measure so that I can still create usable tools for my internal customers. Commented Dec 8, 2016 at 21:17

2 Answers 2

1

You should create only one connection to the database, but allow multiple Excel sheets to access it simultaneously.

To do that, create a program or a service that can access the database, while it serves requests from Excel (or other clients).

You should look into technology like WCF or REST (ASP.NET, Owin, ...) if you want to use Windows technology. You could also create services using other platforms like for example Java.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the suggestions-- I'll look into those.
0

Just create a connection string to the SQL Server and include it in your Excel sheet, as long as the user is connected to the local domain they should be able to use the excel sheet. Something like: in your setting sheet

ConnectionString=
Provider=SQLOLEDB;Data Source=YourSQLServerName;Initial Catalog=YourDatabase;Integrated Security=SSPI;Trusted_Connection=Yes;

and in VBA

Set wsSettings = ThisWorkbook.Sheets("Settings")
Application.DisplayStatusBar = True
    Application.StatusBar = "Contacting SQL Server..."

    Dim conn As ADODB.Connection, rs As ADODB.Recordset
    Set conn = New ADODB.Connection
    conn.Open wsSettings.Range("ConnectionString").value

You don't need the licence to connect to a SQL Server on the same domain.E.G over a billion people use Facebook and Facebook DB stores user profile but the users don't have to pay for using Facebook DB, users are connecting to DB and Facebook pays for the licence to use the DB. Your company has paid the licence so any number of people can connect and retrieve data but the can't install DB on their machine without a licence.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.