Print Page | Close Window

CR9, VB6 & Password Protected MSAccess2K database

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=2348
Printed Date: 17 Apr 2025 at 3:47pm


Topic: CR9, VB6 & Password Protected MSAccess2K database
Posted By: mrbar
Subject: CR9, VB6 & Password Protected MSAccess2K database
Date Posted: 16 Feb 2008 at 12:49am
Hi,
 
Previously, I've created some reports with Crystal Report 9. The data were taken from my MSAccess 2000 database. Then I added the report into my VB6 and then it converted my crystal report from .rpt to .dsr
 
I managed to view the report with the report viewer created by VB6 until later I added password to open my MSAccess database to prevent other people from opening the database directly from MSAccess.
 
I can view the .rpt report from Crystal Report 9 by verifying the database, and then key in the password but how to view the .dsr report from my report viewer?
 
Here are the codes for 1 of my report viewer:
 
Dim Report As New CrystalReport1
Dim CRXDatabaseField As CRAXDRT.DatabaseFieldDefinition

Private Sub cmdClose_Click()
    AdminMenu.Enabled = True
    Unload Me
End Sub

Private Sub cmdRefresh_Click()
    CRViewer91.Refresh
End Sub

Private Sub Form_Load()
    Screen.MousePointer = vbHourglass
    Set CRXDatabaseField = Report.Database.Tables.Item(1).Fields.Item(1)
    Report.RecordSortFields.Add CRXDatabaseField, crAscendingOrder
    CRViewer91.ReportSource = Report
    CRViewer91.ViewReport
    Screen.MousePointer = vbDefault
End Sub

Private Sub Form_Resize()
    CRViewer91.Top = 0
    CRViewer91.Left = 0
    CRViewer91.Height = ScaleHeight
    CRViewer91.Width = ScaleWidth
End Sub

 
Is there any extra code to be added to bypass the database password?


-------------
MRBAR
http://mrbar.sitesled.com



Print Page | Close Window