-1

I am connecting my Excel 2016 document to my SQL Server to pull data from a table. I can get this to work fine but the issue is with the security. I may be remembering this incorrectly but I thought there was a way of storing the username within the connection string with things like the IP but hiding the password. I am connecting to the SQL Server using a SQL connection and not a Trusted Windows account. Is this possible?

Thanks Phil

Community
  • 1
  • 1
PJD
  • 743
  • 2
  • 12
  • 38
  • Anything is possible. – dfundako Mar 14 '18 at 15:57
  • It's very unclear what you are asking here. You say the connection is working, but that there is an issue with security. Is it working, or is there an issue? What is the issue? You've left out critical information (error? code?), otherwise no one can assist here. – Jacob H Mar 14 '18 at 16:03
  • Sorry I will try an make it a little clearer....I have a working connection string but I am having to pass in the SQL username and password, which can be seen by everyone. I don't want the password to be shown in the connection string but store it once I have typed it in once. Hope that helps. – PJD Mar 14 '18 at 16:06
  • What about to use *integrated security*? – Ricardo Pontual Mar 14 '18 at 16:21
  • I would rather not be adding a large number of windows accounts to out SQL installation if I can help it so would rather use a SQL Account to access the necessary data. – PJD Mar 14 '18 at 16:25

1 Answers1

0

I'd suggest creating a dll with the connection details in, compile it and then add this as a reference to the excel and distribute it with the excel.

As a reference heres a link on how to do just that; How to securely store Connection String details in VBA

(Sorry new or I'd suggest how to mark as duplicate)