M
MadCrazyNewbie
Hey Group,
Sorry to be a pain yet again. I problem that i don`t know how to get
around
I use the following connection class on my project:
Private Shared mConnectionsstring As String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
Private Shared mLocation As String
Private Shared connArray As ArrayList
Public Shared Sub setString(ByVal ind As Integer)
Dim connArray As New ArrayList()
connArray.Add("J:\Excellence.Net\LiveNetDB.mdb")
connArray.Add("J:\Excellence.Net\DevNetDB.mdb")
connArray.Add("C:\Program Files\Excellence.Net\LiveLocalDB.mdb")
mLocation = connArray(ind).ToString
End Sub
Public Shared ReadOnly Property [String]() As String
Get
Return "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mLocation & ";"
End Get
End Property
and then I use:
Connection.setString(Me.cboSelectDB.SelectedIndex) on my Login form and
<WhateverDataConnect>.ConnectionString = Connection.String
on the load event of every other form.
And the following to print my Crystal Reports:
rptForm.Text = "Excellence.Net - Fax Meter Reading Report" 'Set the form's
titlebar
rptForm.CRVReportPrint.ReportSource = New FaxMeterReadings() 'Tell the
viewer which report to display
rptForm.CRVReportPrint.RefreshReport() 'Refresh the viewer
rptForm.ShowDialog() 'Show the report
How do I get my report Print to determin which database it using? I.E -
Network or Local? All I can find on my Crystal report is the Set Location,
to which I have to choose a databse.
Many Thanks again for any help
Regards
MCN
Sorry to be a pain yet again. I problem that i don`t know how to get
around
I use the following connection class on my project:
Private Shared mConnectionsstring As String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
Private Shared mLocation As String
Private Shared connArray As ArrayList
Public Shared Sub setString(ByVal ind As Integer)
Dim connArray As New ArrayList()
connArray.Add("J:\Excellence.Net\LiveNetDB.mdb")
connArray.Add("J:\Excellence.Net\DevNetDB.mdb")
connArray.Add("C:\Program Files\Excellence.Net\LiveLocalDB.mdb")
mLocation = connArray(ind).ToString
End Sub
Public Shared ReadOnly Property [String]() As String
Get
Return "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mLocation & ";"
End Get
End Property
and then I use:
Connection.setString(Me.cboSelectDB.SelectedIndex) on my Login form and
<WhateverDataConnect>.ConnectionString = Connection.String
on the load event of every other form.
And the following to print my Crystal Reports:
rptForm.Text = "Excellence.Net - Fax Meter Reading Report" 'Set the form's
titlebar
rptForm.CRVReportPrint.ReportSource = New FaxMeterReadings() 'Tell the
viewer which report to display
rptForm.CRVReportPrint.RefreshReport() 'Refresh the viewer
rptForm.ShowDialog() 'Show the report
How do I get my report Print to determin which database it using? I.E -
Network or Local? All I can find on my Crystal report is the Set Location,
to which I have to choose a databse.
Many Thanks again for any help
Regards
MCN