Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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!

Reply With Quote
  #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
Reply With Quote
  #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!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:58 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.