Connecting Tech Pros Worldwide Help | Site Map

how to bind password protectec access to cr10 using vb6

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 7th, 2009, 05:13 AM
Familiar Sight
 
Join Date: Jan 2007
Posts: 221
Default how to bind password protectec access to cr10 using vb6

i want to use a password protected msaccess database with crytal reprot 10 and vb6 .
i had implemented the following code

Expand|Select|Wrap|Line Numbers
  1. - Add to Reference
  2. '1- Crystal Reports ActiveX Designer Run Time Library 10
  3. '2- Crystal ActiveX Report Viewer Library 10
  4. 'COMPATIBLE VERSION = CRYSTAL REPORT 10
  5.  
  6. Public CRReport As New CRAXDRT.Report
  7. Public CRApp As New CRAXDRT.Application
  8.  
  9. Public Sub CrysRpt(CrytalOCX As Object, RptPath As String, DBPath As String, DBPassword As String)
  10.  
  11. '-Assign Path to Report
  12. Set CRReport = CRApp.OpenReport(App.Path & RptPath)
  13.  
  14. On Error GoTo ExitLabel
  15.  
  16. With CRReport '-// Log-On to Database with Password Protect
  17.  
  18. '-//====================================
  19. .Database.Tables(1).SetLogOnInfo App.Path & DBPath, App.Path & DBPath, "", DBPassword
  20.  
  21. End With
  22.  
  23. With CrytalOCX
  24.  
  25. 'Set the source of Report viewer to the path of Report you made
  26. .ReportSource = CRReport
  27.  
  28. 'View/Display Report
  29. .ViewReport
  30.  
  31. End With
  32.  
  33. CRApp.CanClose
  34.  
  35. Exit Sub
  36.  
  37. ExitLabel: MsgBox Err.Number & " " & Err.Description, vbCritical
  38.  
  39. End Sub
  40.  
what i am doing in making a module and starting my programe with sum main() and writing the above code in module.and calling it by followig the code

Expand|Select|Wrap|Line Numbers
  1. Call CrysRpt(CrytalOCX As Object, app.Path & "\test1.rpt", app.Path & "\Myproject.mdb","abc123" )
but getting error I am facing difficulty how to call this code.so how can i call this.what should i had to write.
Reply
  #2  
Old January 7th, 2009, 09:37 AM
Familiar Sight
 
Join Date: Jan 2007
Posts: 221
Default

I got the mistake i am making.so does not need any more assistance in it.

Thanks
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.