PDA

Click to See Complete Forum and Search --> : Access secure database


KoffieMok
Apr 16th, 2004, 05:13 AM
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

Pasvorto
Apr 16th, 2004, 07:04 AM
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

KoffieMok
Apr 16th, 2004, 07:09 AM
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:

Dim oRpt As CrystalReport1
oRpt = New CrystalReport1
oRpt.SetDatabaseLogon("", "pater2002")

Edit: Thank you for your quick reply though!