|
-
Dec 14th, 2005, 11:36 PM
#1
Thread Starter
New Member
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.
-
Dec 14th, 2005, 11:44 PM
#2
Re: Server has not yet been opened
-
Dec 15th, 2005, 08:02 PM
#3
Thread Starter
New Member
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?
-
Dec 15th, 2005, 08:54 PM
#4
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|