Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Dear Friends.

I am much worried about a critical problem.

I am using the following code to set the Crystal Reports Data source and Database information at run Time.

VB
Dim Rpt As New rptDailyExp

Rpt.DataSourceConnections.Item(0).SetConnection(strDBPath, "HomeDb.mdb", False)  
' strDBPath holds the Path of Database file
Rpt.DataSourceConnections.Item(0).SetLogon("admin", "")
Rpt.SetDataSource(Ds)
CRVSearch.ReportSource = Rpt
CRVSearch.Refresh()


But When the crystal reports is about to launch it asks for User ID and Password.

Please tell me how can I get rid of this error.

Note: I am using VB 2008 and MS Access Database.

I am waiting for response.
Posted
Comments
Prasad Bansi Vagal 13-Aug-10 12:49pm    
Reason for my vote of 5
very good question only you need the technique to bind crystal report to database.

you use wizard to bind crystal report to database, configure the connection type in oleDB object :-D
prasad
 
Share this answer
 
Comments
rashidfarooq 13-Aug-10 14:08pm    
Brother! I want to change the Connection string and Data source of crystal reports to be changed at Run Time. So, Therefore, I am not depending on that wizard (Although I have Wizard to bind report to database.) So, Is there any way to change the connection string and the path of database file at run time. And crystal report does not ask any user name or password.
verify the crystal report path. check if it is the same you provide through code..! :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900