Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Reports

Status
Not open for further replies.

itechC

Programmer
Feb 13, 2003
71
CA
I created a program which has some data reports. The data is coming from an encryted Access database. I have two modules....one that encrypts and one that decrypts. I use these modules to view the data on my forms but when i view my reports all the data is encrypted. How can i decrypt the data i'm sending to the data report. There is a connections directly to the access table in the reports. Can i base it on a view or something else...if so how?

Thanks.
 
Hi, itechC. First of all, I think that you shouldn't need to encrypt manually the data field, because you can protect your database with a password.

Anyway, there is a method you can use to process field by field when the report is being displayed. Do the following:

1. Create a reference to the Microsoft Data Formatting Object Library, and declare a with-events StdDataFormat type variable in the General Declarations section of the report.

2. Init the StdDataFormat object

3. Set the DataFormat property of the control in the DataReport that displays the data, such as a RptTextBox, as the StdDataFormat object

4. In the Format event of the StdDataFormat object, set the DataValue.Value as a variable for the decripting function of your module.

Example:

' In the General Declarations section:
Option Explicit
Private WithEvents oFormat As StdDataFormat

Private Sub DataReport_Initialize()
Set oFOrmat = New StdDataFormat
Set drReport.Sections("Header").Controls("txtName").DataFormat = oFormat
End Sub

Private Sub oFormat_Format(ByVal DataValue As StdFormat.StdDataValue)
On Local Error Resume Next
DataValue.Value = FunctionDecrypt(DataValue.Value)
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top