Results 1 to 8 of 8

Thread: Unable to retrieve Crystal Report with Password Protected Acces DB

  1. #1

    Thread Starter
    Addicted Member SkyCoder's Avatar
    Join Date
    Oct 2003
    Location
    Moon Crater 25
    Posts
    183

    Unable to retrieve Crystal Report with Password Protected Acces DB

    Dim sRep As String
    sRep = "RepStudentResults.rpt"
    cr1.ReportFileName = App.path & "/" & sRep
    cr1.WindowState = crptNormal
    cr1.WindowWidth = 800
    cr1.WindowHeight = 600
    cr1.PrintReport
    cr1.Reset


    This is the code im ussing to retrieve a Crystal Report (ver 8.1) in a vb6 app. The Database i make use of is an access db that is password protected.
    Im having difficulties to retrieve the report
    Do i have to pass the Access pasword to Crystal somewhere or what?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Unable to retrieve Crystal Report with Password Protected Acces DB

    First, your slash is going the wrong way. It should be "\" & sRep
    and second, yes, in order to open a password protected database, you must pass the password.

  3. #3

    Thread Starter
    Addicted Member SkyCoder's Avatar
    Join Date
    Oct 2003
    Location
    Moon Crater 25
    Posts
    183

    Re: Unable to retrieve Crystal Report with Password Protected Acces DB

    How do i pass the database password through crystal?
    something like this:
    VB Code:
    1. cr1.password = "123"

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Unable to retrieve Crystal Report with Password Protected Acces DB

    If you open it with your VB6 front end, then it will already be open when you call your report, so you shouldn't have to pass it to crystal. Only to Access in your connection string.

  5. #5
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Unable to retrieve Crystal Report with Password Protected Acces DB

    Unfurtunity that is not true with crystal. Using Crystal with proteted MS Access database is a real hassel. I use it with many and with versions before CR 9 You need to set a registry entry if you are using groups and user permissions. Crystal supplied a program called sysdb32 that let you do this if you did not want to manipulate the registry manually.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Unable to retrieve Crystal Report with Password Protected Acces DB

    Quote Originally Posted by GaryMazzone
    Unfurtunity that is not true with crystal. Using Crystal with proteted MS Access database is a real hassel. I use it with many and with versions before CR 9 You need to set a registry entry if you are using groups and user permissions. Crystal supplied a program called sysdb32 that let you do this if you did not want to manipulate the registry manually.
    That is good to know. All of my experience with Crystal has been with SQL Server or Oracle.

    If you are using Access, then why wouldn't you want to use Access reports instead of Crystal?

  7. #7

    Thread Starter
    Addicted Member SkyCoder's Avatar
    Join Date
    Oct 2003
    Location
    Moon Crater 25
    Posts
    183

    RESOLVED - Re: Unable to retrieve Crystal Report with Password Protected Acces DB

    Resolved it by passing the password

    cr1.Connect = "DSN=MyApp;UID= ;PWD=123 ;DSQ=MyApp"

    HTML Code:
    Dim sRep As String
    sRep = "RepStudentResults.rpt"
    
    cr1.Connect = "DSN=MyApp;UID= ;PWD=123 ;DSQ=MyApp"
    
    cr1.ReportFileName = App.path & "/" & sRep
    cr1.WindowState = crptNormal
    cr1.WindowWidth = 800
    cr1.WindowHeight = 600
    cr1.PrintReport
    cr1.Reset

  8. #8
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Unable to retrieve Crystal Report with Password Protected Acces DB

    I am programming the app in VB6 and can't be sure a user has Access. So I use crystal for all report output. Also some apps pass data into Excel for graphing functions (only if Excel on the system). For those that use Excel the requirements state that Excel is required to do the graphing. I found that Crystal graphing functions did not perform to my requirements way to simple graphs.
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width