I need to dynamically set the connection string of the Connection object in the data environment. I've tried several ways, none of which worked. Can anyone tell me where to set the string and how to set up the connection object properties in the DE so that it will take any connection string?
Public Function PrintCheckIn(ByVal iDrvrID As Integer, ByVal sBeginDate As String, _
ByVal sEndDate As String, ByVal sTitle As String)
'Print the Check-In Report
Dim ODE As deAccReports
Dim myRpt As rptCheckIn
On Error Resume Next
Set ODE = New deAccReports
Set myRpt = New rptCheckIn
ODE.cnAccess.ConnectionString = App.Path & "\MyDatabase.mdb"
ODE.cmCheckIn_Grouping iDrvrID, sBeginDate, sEndDate
myRpt.Sections("Section4").Controls.Item(4).Caption = sBeginDate & " to " & sEndDate
myRpt.Sections("Section2").Controls.Item(12).Caption = sTitle
If myRpt.Visible = False Then myRpt.Show