Hi,
I have an application using MS Access database and the application is developed using VS.net 2005 and .NET framework 2.0.
Req:
- Need to set up a DSN-less Crystal Report XI using MS Access 2003
- Need to use “Microsoft.Jet.OLE DB.4.0” provider to connect database.
- The database location will change in every installation.
- Database is protected by user id and password
Issue:
I am facing login failed error when the application tried to open report at runtime. Error message “Logon Failed. Please try again.” The problem is that I used Microsoft.Jet.OLE DB.4.0 at design time and provided database details at runtime.
Note: Application is working well when I used DAO provider in the report at design time.
In .Net , I added codes shown below ;
objReport.Load(prReportName)
objReport.DataSourceConnections.Item(0).IntegratedSecurity = False
objReport.DataSourceConnections.Item(0).SetConnection("", strDBLocation, False)
objReport.DataSourceConnections.Item(0).SetLogon("Admin", Password)
rptViewer.ReportSource = objReport
Me.rptViewer.Refresh()
Me.Show()
Thanks,
Manoj Nair
Edited by manojkgr - 11 Feb 2009 at 9:19pm