title: How to secure an ADO connection in an Excel VBA project?
body: <p>I have an Excel spreadsheet (.xlsb) that connects to an SQL Server via ActiveX Data Objects (ADO) in VBA that I have to share with a bunch of people. The code uses the following string to connect do the database:</p>
  
  <pre><code>' Create the connection string.
  sConnString = "Provider=SQLOLEDB;" &amp; _
                "Data Source={server name};" &amp; _
                "Initial Catalog={database name};" &amp; _
                "UserId={username};" &amp; _
                "Password={password};"
  </code></pre>
  
  <p>How do I keep my SQL username and password secure and prevent 3rd parties from gaining access to them? Is password-protecting the VBA project enough or can that be easily cracked?</p>