Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Building my First Crystal Report

Status
Not open for further replies.

Lynus

Technical User
Apr 12, 2003
69
0
0
I have built my first crystal report in CR8. When I built the report I chose a pre-existing access database. I connected to the database and pulled all the fields that I needed to in order to build my report. Works Great!. But now I have a problem. The Database that I need to connect to isnt the same as the one I built the report from. And to make matters worse I need to access it through VB. So I have the CR component loaded and on the aplication. It calls the report this way:

CR1.ReportFileName = App.Path & "\ChaPrint.rpt"
CR1.Action = 1

Now the problem is that ChaPrint is the report name but how do I change the database its pointing to from within VB???

Any ideas would be greatly appreciated.

Thanks

 
You need set then connect property to the required connection string. For example if you are using sqloledb as the provider within the report

Code:
CR1.Connect = "Provider=sqloledb;Data source=myServerName;Initial Catalog=myDBname;User Id=myUsername;Password=myPassword"
 
How do I found out what the provider name is within the report?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top