I am using a ISeries Access ODBC Driver to retrieve data from a AS400.
The connection code looks something like this:
Set myConnect as new ADODB.Connection
With myConnect
.CursorLocation = adUseClient
.Provider = "MSDASQL.1"
.Open "User ID开发者_StackOverflow=<user>;Password=<password>;Data Source=<dsource>"
End With
This worked fine up until now.
The problem is that we have recently introduced encryption to some (ColOne) of the library columns.
A inline SQL string that used to look like this:
SELECT ColOne FROM libOne.ColOne WHERE ColOne = <val>
Now needs to look like this:
SELECT F_DecFld('FieldIdentifier',ColOne) AS ColOne FROM libOne.ColOne WHERE ColOne = <val>
I know the F_DecFld() function resides in the crypto library, I have included it in my ODBC and when I run the same query in WinSQL (Also uses the ODBC) it returns the data as expected, but from my program it returns the data without decrypting (no error).
The only thing I can think of at this point is that the Microsoft ActiveX Data Objects 2.8 Library is not taking the F_DecFld() into consideration?
Thank you.
Get an ODBC trace as per http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/rzaii/rzaiiodbc17.htm to see a detailed accounting of what is going on (and hopefully an error message from the driver)
crypto library needs to be added to the AS400 user profile and not just in the library list on the ODBC driver.
精彩评论