Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
| Search | Today's Posts | Mark Forums Read
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 29th, 2007, 10:59 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Crystal Report 9 password protected mdb ACCESS

Hi,

I can access my protected mdb in the CR designer in VB6 via giving it the password when I make the connection via wizard but when I run the software it forgets the password and does not connect to the DB at run time. I am using Crystal Report 9

How can I supply the password in my code?

Code:
dim Report as new myrep 'myrep is the report in the designer

Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer91.ReportSource = Report
CRViewer91.ViewReport
Screen.MousePointer = vbDefault
End Sub
Hoping to receive an early reply.

Take care, Peace!

  #2 (permalink)  
Old July 26th, 2007, 07:44 PM
Registered User
 
Join Date: Oct 2005
Location: Miami, FL, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try this:
Sub PrintReport()

    Dim Password as String
    Dim crxReport As CRAXDRT.Report
    Dim crxTable As CRAXDRT.DatabaseTable
    Dim mcrxApplication As New CRAXDRT.Application

    Screen.MousePointer = vbHourglass
    Set CRXReport = crxApplication.OpenReport( _
        App.Path & "\MyReport.rpt", 1)
    Password = "MyPassword"
    CRViewer91.ReportSource = crxReport

        For Each crxTable In crxReport.Database.Tables
            crxTable.SetSessionInfo "", Chr(10) & Password
        Next crxTable

    CRViewer91.ViewReport
    Screen.MousePointer.vbNormal

End Sub



Best Regards,

Al Weisenborn
  #3 (permalink)  
Old July 27th, 2007, 02:29 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Bro,

Unfortunately this is not working and I get "Could not find installable ISAM" error message. When I hit the refresh button on the top it says "Not a valid password"

I know that the password is correct since the VB front-end using the password protected mdb is working fine; it's the Crystal Report that does not retrieve the data from the password protected mdb.

Note (just in case if there is a confusion): I am using a password protected mdb not a password protected Crystal report (the report object is in the VB designer and accessing via ADODB MS JET 4 engine).

Take care, Peace!



Similar Threads
Thread Thread Starter Forum Replies Last Post
crystal report9 with password protected MSACCESS zrtv Beginning VB 6 4 April 22nd, 2009 03:23 PM
CRystal Reports XI - Access mdb and dbase rturner003 Crystal Reports 0 May 29th, 2007 09:56 AM
sub report in a password protected access database aasheesh_jha Crystal Reports 0 January 2nd, 2007 07:09 PM
Passwrd protected mdb file from Crystl Rpt in vb6 Kaustav Pro VB Databases 1 October 24th, 2005 08:08 PM
Access and embedding Password Protected Documents dkb Access 4 January 16th, 2004 09:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.