Its is being done with a SSL cert on the web server.
I have the code to decrypt and it works but this is the issue.
I created the InfoPath form via connection to the SQL DB on another server. Once the form was linked I have the Query and Mydata fields. I created the entire form with only one query field (Application Date). When I look at the SQL Statement it is like this (abbreviated).
select "EmpLName","EmpFName","EmpMI","AppDate"," ApplicationID","SSN_Encrypt" from "dbo"."Tablename" as "Tablename"
I tried doing this-
OPEN SYMMETRIC KEY "Keyname" (no quotes)
DECRYPTION BY CERTIFICATE "Certname"; (no quotes)
select "EmpLName","EmpFName","EmpMI","AppDate"," ApplicationID","
CONVERT(char, DecryptByKey(keyname))
AS 'SSN'
FROM dbo.Tablenamee" as "Tablename"
What this does is take away my query field. It becomes unbound and I only have MyData fields avaiable in the datasource section. The run query cmd button works and the SSN comes in correctly but It brings in all applications submitted to the DB.
I need to be able to query on the appdate.
Hope this helps