Crystal Reports and Secured Database 
Author Message
 Crystal Reports and Secured Database

Hi, this is what I do...........

I have two Access databases, one on our server that is secured (data.mdb)
and one on my machine (design.mdb) that isn't.  I use my design.mdb for
creating reports, VB forms, etc.  At runtime I change the database to the
secured database file name and login using the following code:

'************  frmLogin has two text boxes, one for user id and one for
password *********
Sub cmdLogIn_Click()
On Error GoTo LoginError
   Static Counter as Integer
   Dim Message as String
   'strUser and strPassword are globally defined in a module
   strUser = txtUser.Text  
   strPassword = txtPassword.Text
   SetDefaultWorkspace strUser, strPassword

   Unload frmLogin
   Exit Sub

   Counter = Counter + 1
   Message = "You have entered an invalid User or Password" & Chr(13) &
   Message = Message & "You have " & 4 - Counter & "tries left!"

   MsgBox Message, MB_ICONSTOP, "Invalid User or Password"
   If Counter = 4 Then
      Unload frmLogin
   End If
   Exit Sub
End Sub

********** To print out a Crystal Report: ****************
Sub cmdEmployeeRpt_Click()
On Error GoTo EmployeeErr
   rptEmployee.UserName = strUser
   rptEmployee.Password = strPassword
   rptEmployee.Action = 1
   Exit Sub
   MsgBox Error$
   Exit Sub
End Sub

Hope this helps anyone interested.  Questions can be sent directly to me.

Thu, 01 Jan 1998 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Crystal Reports and secured database

2. Crystal Reports and Secure databases

3. Secure database and Crystal Reports


5. Use Crystal Reports & Secured Databases

6. Secured Database & Crystal Report

7. Crystal Reports and Secure Access Tables

8. How to crystal report from secure MDB??

9. Crystal Reports and Secure Access Tables

10. Using Secured *.mdb's with Crystal Reports

11. Securing Crystal Reports

12. How to crystal report from secure MDB??


Powered by phpBB® Forum Software