Hi
How do I open the password protected .mdb when there is sub reports in the Crystal Report. I got it to work on reports which contains no subreports. The problem is with the ones thats got subreports. It crashes the calling program and generate the runtime error 20535
unable to open database incorrect session parameters.
Please help me.Hi
How do I open the password protected .mdb when there is sub reports in the Crystal Report. I got it to work on reports which contains no subreports. The problem is with the ones thats got subreports. It crashes the calling program and generate the runtime error 20535
unable to open database incorrect session parameters.
Please help me.
Urgent need please help me.
Showing posts with label protected. Show all posts
Showing posts with label protected. Show all posts
Thursday, March 8, 2012
Crystal Report and Deployment
I have a winform application that I want to deploy.
It has a password protected Access database in the bin folder where it pulls all its information.
I have set up a crystal report to read the information and all works well when I am debugging it on my machine. Meaning it connects to the password protected database without asking what the server name, database name, or password was.
However when I deploy the application, if I click to view the crystal report, it opens a screen labeled Database Login. Asking for the Server Name, Database, Login ID and Password. However I don't want this box to pop up and just have the crystal report connect to the database deployed with the application.
The problem is that I think it is trying to look in the folder that the database was in on the computer I was developing it on.
I connnect to the database like so for the crystal report
Dim crpt_Attendance As New Attendance
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim Login As CrystalDecisions.Shared.TableLogOnInfo
For Each myTable In crpt_Attendance.Database.Tables
Login = myTable.LogOnInfo
Login.ConnectionInfo.Password = "RTr@.k"
Login.ConnectionInfo.UserID = ""
myTable.ApplyLogOnInfo(Login)
Next
crptv_Attendance.ReportSource = crpt_Attendance
I have included the Access Database in the Application folder when I deploy it. And before I create the report, I have a datagrid that reads the information from this database. So I don't know why the crystal report is looking at the location from the computer I created it on and not in the application folder.
Any help is greatly appreciated as I am not very familiar with crystal reports!Make sure you don't have the Database Path hardcoded somewhere in VB or Crystal.|||I only have CR 8.5 developer, but in it you have to set the .ReportSource and you can specify the .SetLogOnInfo.
oReport.Database.Tables(1).SetLogOnInfo sServer, sDatabase, sUserName, sUserPwd
It has a password protected Access database in the bin folder where it pulls all its information.
I have set up a crystal report to read the information and all works well when I am debugging it on my machine. Meaning it connects to the password protected database without asking what the server name, database name, or password was.
However when I deploy the application, if I click to view the crystal report, it opens a screen labeled Database Login. Asking for the Server Name, Database, Login ID and Password. However I don't want this box to pop up and just have the crystal report connect to the database deployed with the application.
The problem is that I think it is trying to look in the folder that the database was in on the computer I was developing it on.
I connnect to the database like so for the crystal report
Dim crpt_Attendance As New Attendance
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim Login As CrystalDecisions.Shared.TableLogOnInfo
For Each myTable In crpt_Attendance.Database.Tables
Login = myTable.LogOnInfo
Login.ConnectionInfo.Password = "RTr@.k"
Login.ConnectionInfo.UserID = ""
myTable.ApplyLogOnInfo(Login)
Next
crptv_Attendance.ReportSource = crpt_Attendance
I have included the Access Database in the Application folder when I deploy it. And before I create the report, I have a datagrid that reads the information from this database. So I don't know why the crystal report is looking at the location from the computer I created it on and not in the application folder.
Any help is greatly appreciated as I am not very familiar with crystal reports!Make sure you don't have the Database Path hardcoded somewhere in VB or Crystal.|||I only have CR 8.5 developer, but in it you have to set the .ReportSource and you can specify the .SetLogOnInfo.
oReport.Database.Tables(1).SetLogOnInfo sServer, sDatabase, sUserName, sUserPwd
Crystal Report 9 and Password Protected Database
Any body who can help me to connect Password Protected MS Access Database from Active X Crystal Report Engine:
I tried as under:
Dim CRApp As New CRAXDRT.Application
Dim CRRpt As New CRAXDRT.Report
Set CRRpt = CRApp.OpenReport(App.Path & "\Reports\" & ReportFileName & ".rpt")
CRRpt.DiscardSavedData
CRViewer.ViewReport
But It causes an error described as under:
----------------
LogOn Failed.
Detials: ADO Error Code 0x80040e4d
Source: Microsoft Jet Database Engine
Description: Not a Valid Password
SQL State: 3031
Native Error: -124782449
----------------
How can I get rid off this error by supplying login info or password?Thnak for all the visitor to my question!
I have solved the problem.
Dim CRApp As New CRAXDRT.Application
Dim CRRpt As New CRAXDRT.Report
Set CRRpt = CRApp.OpenReport(App.Path & "\Reports\Products.rpt")
CRRpt.DiscardSavedData
CRRpt.Database.Tables(1).ConnectionProperties("Jet OLEDB:Database Password") = "My_Password"
CRViewer.ViewReport
I tried as under:
Dim CRApp As New CRAXDRT.Application
Dim CRRpt As New CRAXDRT.Report
Set CRRpt = CRApp.OpenReport(App.Path & "\Reports\" & ReportFileName & ".rpt")
CRRpt.DiscardSavedData
CRViewer.ViewReport
But It causes an error described as under:
----------------
LogOn Failed.
Detials: ADO Error Code 0x80040e4d
Source: Microsoft Jet Database Engine
Description: Not a Valid Password
SQL State: 3031
Native Error: -124782449
----------------
How can I get rid off this error by supplying login info or password?Thnak for all the visitor to my question!
I have solved the problem.
Dim CRApp As New CRAXDRT.Application
Dim CRRpt As New CRAXDRT.Report
Set CRRpt = CRApp.OpenReport(App.Path & "\Reports\Products.rpt")
CRRpt.DiscardSavedData
CRRpt.Database.Tables(1).ConnectionProperties("Jet OLEDB:Database Password") = "My_Password"
CRViewer.ViewReport
Subscribe to:
Posts (Atom)