Click to See Complete Forum and Search --> : passing vb connection variable to crystal
SCOTTTT
October 18th, 2005, 02:06 PM
I have an application written in vb .net that has a reporting function using crystal. At present all reports are working fine but I would like to be able to let the user select the database to report on, so when the report button is pressed the path to the database is passed to the crystal reports connection parameter.
I have database path currently assigned to a variable called 'cons' in vb but need to set 'cons' as the connection in crystal.
Can anyone advise.
Many Thanks
Scott
Madhi
October 22nd, 2005, 09:21 AM
Try this
CR.Database="Path"
SCOTTTT
October 23rd, 2005, 08:48 AM
Madhi, Thank you for your responce.
The CR part of the string is not recognised, am i missing a reference to Crystal?
I asume this code is placed either in the Form Load event or CrystalReportViewer2 load event.
Regards
Scott
Madhi
October 24th, 2005, 01:46 AM
You need to add reference
Crystal Reports 9 ActiveX Designer Run Time Library
Then
Dim Crapp As New CRAXDRT.Application
CrRpt.Database.AddOLEDBSource cons
SCOTTTT
October 24th, 2005, 03:30 PM
The nearest reference I get to that is Crystal Reports.net activeXDesigner and run time libary. Version 2.0.
I added this but CRAXDRT.Application and CrRpt is causing an un defined error.
Any Ideas.
Many thanks for your time
Scott
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.