Print Page | Close Window

Microsoft.Jet.OLE DB.4.0 ,Crystal Report and .NET

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=5492
Printed Date: 08 May 2024 at 3:18pm


Topic: Microsoft.Jet.OLE DB.4.0 ,Crystal Report and .NET
Posted By: manojkgr
Subject: Microsoft.Jet.OLE DB.4.0 ,Crystal Report and .NET
Date Posted: 11 Feb 2009 at 9:08pm

Hi,

 

I have an application using MS Access database and the application is developed using VS.net 2005 and .NET framework 2.0.

 

Req:

  1. Need to set up a DSN-less Crystal Report XI using MS Access 2003
  2. Need to use “Microsoft.Jet.OLE DB.4.0” provider to connect database.
  3. The database location will change in every installation.
  4. 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




Print Page | Close Window