|
-
Apr 16th, 2004, 05:13 AM
#1
Thread Starter
Junior Member
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
-
Apr 16th, 2004, 07:04 AM
#2
PowerPoster
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
-
Apr 16th, 2004, 07:09 AM
#3
Thread Starter
Junior Member
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:
Dim oRpt As CrystalReport1
oRpt = New CrystalReport1
oRpt.SetDatabaseLogon("", "pater2002")
Edit: Thank you for your quick reply though!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|