Crystal Report viewer- Server has not yet been opened











up vote
1
down vote

favorite












I Have a vb6 application using crystal report 8.5 and sql server 2005.My issue is that when I print report i get Server has not yet been opened.Here is my code in vb.:



Option Explicit
Dim ctr As Integer
Dim cn As New ADODB.Connection--Provider=SQLOLEDB.1;Password=password;Persist Security Info=True;User ID=user ID;Initial Catalog=database Name;Data Source=server Name
Dim crApp As CRAXDRT.Application
Dim crReport As CRAXDRT.Report
Dim crtable As CRAXDRT.DatabaseTable

Private Sub prin_Click()
Dim rs As New ADODB.Recordset
Set cn = New ADODB.Connection
cn.ConnectionString = MDI1.txtado
cn.Open
Set rs = New ADODB.Recordset
rs.Open "select * from temp_abs_yes", cn, adOpenKeyset, adLockOptimistic
Set crApp = New CRAXDRT.Application
Set crReport = crApp.OpenReport("C:Usersuser1.domDesktopANPabs_yes.rpt")
crReport.Database.Tables.Item(1).SetLogOnInfo "servername", "databasename", "user", "password"
crReport.Database.Tables.Item(1).SetDataSource rs, 3
crReport.DiscardSavedData
Viewer.ReportSource = crReport
Viewer.ViewReport
rs.close
Set rs = Nothing
Set crReport = Nothing
Set crApp = Nothing
End Sub









share|improve this question




























    up vote
    1
    down vote

    favorite












    I Have a vb6 application using crystal report 8.5 and sql server 2005.My issue is that when I print report i get Server has not yet been opened.Here is my code in vb.:



    Option Explicit
    Dim ctr As Integer
    Dim cn As New ADODB.Connection--Provider=SQLOLEDB.1;Password=password;Persist Security Info=True;User ID=user ID;Initial Catalog=database Name;Data Source=server Name
    Dim crApp As CRAXDRT.Application
    Dim crReport As CRAXDRT.Report
    Dim crtable As CRAXDRT.DatabaseTable

    Private Sub prin_Click()
    Dim rs As New ADODB.Recordset
    Set cn = New ADODB.Connection
    cn.ConnectionString = MDI1.txtado
    cn.Open
    Set rs = New ADODB.Recordset
    rs.Open "select * from temp_abs_yes", cn, adOpenKeyset, adLockOptimistic
    Set crApp = New CRAXDRT.Application
    Set crReport = crApp.OpenReport("C:Usersuser1.domDesktopANPabs_yes.rpt")
    crReport.Database.Tables.Item(1).SetLogOnInfo "servername", "databasename", "user", "password"
    crReport.Database.Tables.Item(1).SetDataSource rs, 3
    crReport.DiscardSavedData
    Viewer.ReportSource = crReport
    Viewer.ViewReport
    rs.close
    Set rs = Nothing
    Set crReport = Nothing
    Set crApp = Nothing
    End Sub









    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I Have a vb6 application using crystal report 8.5 and sql server 2005.My issue is that when I print report i get Server has not yet been opened.Here is my code in vb.:



      Option Explicit
      Dim ctr As Integer
      Dim cn As New ADODB.Connection--Provider=SQLOLEDB.1;Password=password;Persist Security Info=True;User ID=user ID;Initial Catalog=database Name;Data Source=server Name
      Dim crApp As CRAXDRT.Application
      Dim crReport As CRAXDRT.Report
      Dim crtable As CRAXDRT.DatabaseTable

      Private Sub prin_Click()
      Dim rs As New ADODB.Recordset
      Set cn = New ADODB.Connection
      cn.ConnectionString = MDI1.txtado
      cn.Open
      Set rs = New ADODB.Recordset
      rs.Open "select * from temp_abs_yes", cn, adOpenKeyset, adLockOptimistic
      Set crApp = New CRAXDRT.Application
      Set crReport = crApp.OpenReport("C:Usersuser1.domDesktopANPabs_yes.rpt")
      crReport.Database.Tables.Item(1).SetLogOnInfo "servername", "databasename", "user", "password"
      crReport.Database.Tables.Item(1).SetDataSource rs, 3
      crReport.DiscardSavedData
      Viewer.ReportSource = crReport
      Viewer.ViewReport
      rs.close
      Set rs = Nothing
      Set crReport = Nothing
      Set crApp = Nothing
      End Sub









      share|improve this question















      I Have a vb6 application using crystal report 8.5 and sql server 2005.My issue is that when I print report i get Server has not yet been opened.Here is my code in vb.:



      Option Explicit
      Dim ctr As Integer
      Dim cn As New ADODB.Connection--Provider=SQLOLEDB.1;Password=password;Persist Security Info=True;User ID=user ID;Initial Catalog=database Name;Data Source=server Name
      Dim crApp As CRAXDRT.Application
      Dim crReport As CRAXDRT.Report
      Dim crtable As CRAXDRT.DatabaseTable

      Private Sub prin_Click()
      Dim rs As New ADODB.Recordset
      Set cn = New ADODB.Connection
      cn.ConnectionString = MDI1.txtado
      cn.Open
      Set rs = New ADODB.Recordset
      rs.Open "select * from temp_abs_yes", cn, adOpenKeyset, adLockOptimistic
      Set crApp = New CRAXDRT.Application
      Set crReport = crApp.OpenReport("C:Usersuser1.domDesktopANPabs_yes.rpt")
      crReport.Database.Tables.Item(1).SetLogOnInfo "servername", "databasename", "user", "password"
      crReport.Database.Tables.Item(1).SetDataSource rs, 3
      crReport.DiscardSavedData
      Viewer.ReportSource = crReport
      Viewer.ViewReport
      rs.close
      Set rs = Nothing
      Set crReport = Nothing
      Set crApp = Nothing
      End Sub






      crystal-reports crystal-reports-8.5






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 18 '11 at 15:24









      PowerUser

      8,053165189




      8,053165189










      asked Feb 15 '11 at 8:17









      Monshine

      181411




      181411
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          I think doing "SetLogOnInfo" is innecesary in that case, as you are assigning the data to report



          Probably is not your case, but for the help of someone else.



          I got that error when I assigned the servername parameter incorrectly.



          The correct parameters I used for logon (for an oracle DB):



          [...]Item(1).SetLogOnInfo "[tnsnames]", "", "[db user]", "[db password]"






          share|improve this answer























          • I resolved it by creating a dsn,then put it in my code for setlogon info and it wrok
            – Monshine
            May 19 '11 at 10:44


















          up vote
          0
          down vote













          I resolved by updating dll




          p2soledb.dll




          in c:WindowsCrystal I got the details from here






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f5001236%2fcrystal-report-viewer-server-has-not-yet-been-opened%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            I think doing "SetLogOnInfo" is innecesary in that case, as you are assigning the data to report



            Probably is not your case, but for the help of someone else.



            I got that error when I assigned the servername parameter incorrectly.



            The correct parameters I used for logon (for an oracle DB):



            [...]Item(1).SetLogOnInfo "[tnsnames]", "", "[db user]", "[db password]"






            share|improve this answer























            • I resolved it by creating a dsn,then put it in my code for setlogon info and it wrok
              – Monshine
              May 19 '11 at 10:44















            up vote
            0
            down vote













            I think doing "SetLogOnInfo" is innecesary in that case, as you are assigning the data to report



            Probably is not your case, but for the help of someone else.



            I got that error when I assigned the servername parameter incorrectly.



            The correct parameters I used for logon (for an oracle DB):



            [...]Item(1).SetLogOnInfo "[tnsnames]", "", "[db user]", "[db password]"






            share|improve this answer























            • I resolved it by creating a dsn,then put it in my code for setlogon info and it wrok
              – Monshine
              May 19 '11 at 10:44













            up vote
            0
            down vote










            up vote
            0
            down vote









            I think doing "SetLogOnInfo" is innecesary in that case, as you are assigning the data to report



            Probably is not your case, but for the help of someone else.



            I got that error when I assigned the servername parameter incorrectly.



            The correct parameters I used for logon (for an oracle DB):



            [...]Item(1).SetLogOnInfo "[tnsnames]", "", "[db user]", "[db password]"






            share|improve this answer














            I think doing "SetLogOnInfo" is innecesary in that case, as you are assigning the data to report



            Probably is not your case, but for the help of someone else.



            I got that error when I assigned the servername parameter incorrectly.



            The correct parameters I used for logon (for an oracle DB):



            [...]Item(1).SetLogOnInfo "[tnsnames]", "", "[db user]", "[db password]"







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jul 19 '11 at 16:09

























            answered May 5 '11 at 22:32









            Frajmen

            816




            816












            • I resolved it by creating a dsn,then put it in my code for setlogon info and it wrok
              – Monshine
              May 19 '11 at 10:44


















            • I resolved it by creating a dsn,then put it in my code for setlogon info and it wrok
              – Monshine
              May 19 '11 at 10:44
















            I resolved it by creating a dsn,then put it in my code for setlogon info and it wrok
            – Monshine
            May 19 '11 at 10:44




            I resolved it by creating a dsn,then put it in my code for setlogon info and it wrok
            – Monshine
            May 19 '11 at 10:44












            up vote
            0
            down vote













            I resolved by updating dll




            p2soledb.dll




            in c:WindowsCrystal I got the details from here






            share|improve this answer

























              up vote
              0
              down vote













              I resolved by updating dll




              p2soledb.dll




              in c:WindowsCrystal I got the details from here






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                I resolved by updating dll




                p2soledb.dll




                in c:WindowsCrystal I got the details from here






                share|improve this answer












                I resolved by updating dll




                p2soledb.dll




                in c:WindowsCrystal I got the details from here







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 14 at 5:05









                Naushad Qamar

                5429




                5429






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f5001236%2fcrystal-report-viewer-server-has-not-yet-been-opened%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    鏡平學校

                    ꓛꓣだゔៀៅຸ໢ທຮ໕໒ ,ໂ'໥໓າ໼ឨឲ៵៭ៈゎゔit''䖳𥁄卿' ☨₤₨こゎもょの;ꜹꟚꞖꞵꟅꞛေၦေɯ,ɨɡ𛃵𛁹ޝ޳ޠ޾,ޤޒޯ޾𫝒𫠁သ𛅤チョ'サノބޘދ𛁐ᶿᶇᶀᶋᶠ㨑㽹⻮ꧬ꧹؍۩وَؠ㇕㇃㇪ ㇦㇋㇋ṜẰᵡᴠ 軌ᵕ搜۳ٰޗޮ޷ސޯ𫖾𫅀ल, ꙭ꙰ꚅꙁꚊꞻꝔ꟠Ꝭㄤﺟޱސꧨꧼ꧴ꧯꧽ꧲ꧯ'⽹⽭⾁⿞⼳⽋២៩ញណើꩯꩤ꩸ꩮᶻᶺᶧᶂ𫳲𫪭𬸄𫵰𬖩𬫣𬊉ၲ𛅬㕦䬺𫝌𫝼,,𫟖𫞽ហៅ஫㆔ాఆఅꙒꚞꙍ,Ꙟ꙱エ ,ポテ,フࢰࢯ𫟠𫞶 𫝤𫟠ﺕﹱﻜﻣ𪵕𪭸𪻆𪾩𫔷ġ,ŧآꞪ꟥,ꞔꝻ♚☹⛵𛀌ꬷꭞȄƁƪƬșƦǙǗdžƝǯǧⱦⱰꓕꓢႋ神 ဴ၀க௭எ௫ឫោ ' េㇷㇴㇼ神ㇸㇲㇽㇴㇼㇻㇸ'ㇸㇿㇸㇹㇰㆣꓚꓤ₡₧ ㄨㄟ㄂ㄖㄎ໗ツڒذ₶।ऩछएोञयूटक़कयँृी,冬'𛅢𛅥ㇱㇵㇶ𥄥𦒽𠣧𠊓𧢖𥞘𩔋цѰㄠſtʯʭɿʆʗʍʩɷɛ,əʏダヵㄐㄘR{gỚṖḺờṠṫảḙḭᴮᵏᴘᵀᵷᵕᴜᴏᵾq﮲ﲿﴽﭙ軌ﰬﶚﶧ﫲Ҝжюїкӈㇴffצּ﬘﭅﬈軌'ffistfflſtffतभफɳɰʊɲʎ𛁱𛁖𛁮𛀉 𛂯𛀞నఋŀŲ 𫟲𫠖𫞺ຆຆ ໹້໕໗ๆทԊꧢꧠ꧰ꓱ⿝⼑ŎḬẃẖỐẅ ,ờỰỈỗﮊDžȩꭏꭎꬻ꭮ꬿꭖꭥꭅ㇭神 ⾈ꓵꓑ⺄㄄ㄪㄙㄅㄇstA۵䞽ॶ𫞑𫝄㇉㇇゜軌𩜛𩳠Jﻺ‚Üမ႕ႌႊၐၸဓၞၞၡ៸wyvtᶎᶪᶹစဎ꣡꣰꣢꣤ٗ؋لㇳㇾㇻㇱ㆐㆔,,㆟Ⱶヤマފ޼ޝަݿݞݠݷݐ',ݘ,ݪݙݵ𬝉𬜁𫝨𫞘くせぉて¼óû×ó£…𛅑הㄙくԗԀ5606神45,神796'𪤻𫞧ꓐ㄁ㄘɥɺꓵꓲ3''7034׉ⱦⱠˆ“𫝋ȍ,ꩲ軌꩷ꩶꩧꩫఞ۔فڱێظペサ神ナᴦᵑ47 9238їﻂ䐊䔉㠸﬎ffiﬣ,לּᴷᴦᵛᵽ,ᴨᵤ ᵸᵥᴗᵈꚏꚉꚟ⻆rtǟƴ𬎎

                    Why https connections are so slow when debugging (stepping over) in Java?