ODBC Connection to SQL Server Always Encrypted

CPGDeveloper

Board Regular
Joined
Oct 8, 2008
Messages
190
Hello~

I've been scouring the internet for answers and can't seem to find a solution. I have an MS Access Front End/Azure SQL Server Back End.

I've been tasked with encrypting certain columns, and that part is relatively simple as SSMS has a user friendly tool to do just that. I need to however decrypt these columns for the end user.

With VB.Net or C#, simply adding 'Column Encryption Setting = Enabled' to the connection string decrypts the columns in question, however I cannot seem to get any equivalent to work with MS Access. I am connecting to SQL Server using ODBC Driver 17 for SQL Server.

Anyone out there have experience with this issue? Is there a magical connection string that would work here?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
I somehow figured it out -- for anyone who might need this -- this is the connection string I used that decrypted an always decrypted column in SQL Server. For this to work, you will have to go through the steps to decrypt on SQL Server (SSMS has a fairly user friendly GUI Tool).

Here are two good articles explaining that process:
SQL Server 2016 - Always Encrypted – SQLServerCentral


Encrypting will produce a certificate that will be part of your windows user profile. As I understand it, that certificate will need to be present on any end user's user profile as well. Anyway, here's the text of the DSN that worked for me (this is with ODBC Driver 17 for SQL Server -- obviously replace 'MYDB' and 'MYSERVER' with your db and server names respectively):

[ODBC]
DRIVER=ODBC Driver 17 for SQL Server
ColumnEncryption=Enabled
TrustServerCertificate=Yes
DATABASE=MYDB
APP=Microsoft Office
Trusted_Connection=Yes
SERVER=MYSERVER

I hope this is helpful.
 
Upvote 0
Solution

Forum statistics

Threads
1,224,828
Messages
6,181,201
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top