Results 1 to 3 of 3

Thread: Access secure database

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    27

    Access secure database

    Hello all,

    I have a question regarding CR & VB.Net

    I made a report in CR that connects to a secured database with a databasepassword (Office XP MS Access)
    For the report to work I entered the password for the database and that works fine.
    Now I added a report viewer in my app. that has ReportSource = SupplierOverview.rpt (The report I just mentioned)
    If I now start my app, the program will ask me for the database password, which was not supposed to be the idea!
    Can anyone tell me how I can send the password to the app automatically, so the user won't have to enter it each time?

    Thanks in advance!

    Edit:Typo
    *(^.^); c(_)

  2. #2
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951
    What level CR are you using?

    Here is some code I use in CR9:

    Set Report = crxApplication.OpenReport("Z:\DAD\InkValueOnHand.rpt", 1)

    For Each crxDatabaseTable In Report.Database.Tables
    crxDatabaseTable.SetDataSource ("Z:\DAD\Techni.mdb")
    crxDatabaseTable.ConnectionProperties("Password") = myPasswordTechni
    Next crxDatabaseTable

    Report.SelectPrinter glbPrinterDriver, glbPrinterName, glbPrinterPort

    Report.PaperOrientation = crDefaultPaperOrientation

    If glbPrinterDestination = 0 Then
    glbReportForm = "frmProduction"
    CRViewer.Show vbModal
    Else
    Report.PrintOut False
    End If

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    27
    Heh, I was just about to close this thread as I found it somewhere on the net...

    The code I was looking for is submitted as soon as I load the viewer, which is in the form_load event:

    VB Code:
    1. Dim oRpt As CrystalReport1
    2. oRpt = New CrystalReport1
    3. oRpt.SetDatabaseLogon("", "pater2002")

    Edit: Thank you for your quick reply though!
    *(^.^); c(_)

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