Results 1 to 4 of 4

Thread: Server has not yet been opened

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Location
    Philippines
    Posts
    11

    Question 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.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Server has not yet been opened

    take a look at www.connectionstrings.com

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2005
    Location
    Philippines
    Posts
    11

    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?

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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
  •  



Click Here to Expand Forum to Full Width