Server has not yet been opened
I have a problem regarding on my report because my database has a password. I have an embedded crystal report in my program and everytime i am trying to open the report it prompts me with " Server has not been opened". I don't know what code shall i put for the server to be opened
Public Sub ShowDailytimeReport(strLoc, dtmFrom, dtmTo)
Dim varreport As New rptReport1
varreport.EnableParameterPrompting = False
varreport.ParameterFields(1).ClearCurrentValueAndRange
varreport.ParameterFields(1).AddCurrentValue CStr(strLoc)
varreport.ParameterFields(2).ClearCurrentValueAndRange
varreport.ParameterFields(2).AddCurrentValue CStr(dtmFrom)
varreport.ParameterFields(3).ClearCurrentValueAndRange
varreport.ParameterFields(3).AddCurrentValue CStr(dtmTo)
CRViewer1.ReportSource = varreport
CRViewer1.EnableRefreshButton = True
CRViewer1.ViewReport
End Sub
what shall i add in that code to open the server?
i thought of the rptReport1.Database.LogOnServer ......
but it was wrong..
please help me on this.
Re: Server has not yet been opened
Re: Server has not yet been opened
i already knew the connecton string, but my problem is do i have to creat another connection string where in fact i already have created it to connect to my access database to add, delete ........ but my problem is reporting. Do i have to create another coneection string for the crystal report?
Re: Server has not yet been opened
Where are you opening your report? You are creating a new instance each time the procedure runs. You need to use the .LogOnServer method to aviod the error. What db are you using? Your connectionstring is not the issue for this error. ;)