Solved

"Server has not yet been opened" while running thru VB6.0

Posted on 2002-07-10
7
510 Views
Last Modified: 2008-02-01
Hi,
I have created a simple crystal report and I am running with VB6.0 . Its working fine on the same computer on which Crystal report has been created but once I am deploying crystal report on the ohter machine & running there then I am getting msg "Server has not yet been opened". I am using the same ODBC & ODBS's configration.
I have coded VB to run the Crystal report like this...
In thie form CRViewer has been embaded and named as CRViewer1 .

    Dim globreport As CRAXDRT.report
    Dim objCrApp As CRAXDRT.Application  
    Dim report As CRAXDRT.report  
   
    Set objCrApp = New CRAXDRT.Application
    Set globreport = objCrApp.OpenReport(RepName)
    CRViewer1.ReportSource = globreport
    CRViewer1.ViewReport


Please help me out.
0
Comment
Question by:hmnpa
  • 5
7 Comments
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 7144983
Ordinarily, you would not get this error message unless you are calling the logon to server functions in Crystal, and I don't see that you are in your code example.

These articles from Crystal Decisions may point you in the right direction for correcting your error:

http://support.crystaldecisions.com/library/kbase/articles/c2011321.asp

http://support.crystaldecisions.com/library/kbase/articles/c2002649.asp

For a list of all support articles containing your error message, try here:

http://support.crystaldecisions.com/library/kbase.asp?q1=server+has+not+yet+been+opened&freeText=0&q2=&so=Rank%5Bd%5D&q3=--+all+categories+--&summary=1&q4=--+all+subjects+--&MaxRec=10&c2=@META_KBASEPRODUCT&c3=@META_KBASECATEGORY&c4=@META_KBASESUBJECT&ct=livecommunity-kbase&language=EN&indexq2=0&indexq3=0&indexq4=0

Hope this helps
DRRYAN3
0
 

Author Comment

by:hmnpa
ID: 7147051
But I am not having crystal report s/w on my other m/c which is giving me this problem. So how can I set the location in report?
I did 'set location' on my test machine and moved over the production m/c as per the http://support.crystaldecisions.com/library/kbase/articles/c2011321.asp but when I am running over my test m/c its working fine but again when I am running over the production machine I am getting the same error.

Advice me...
0
 

Author Comment

by:hmnpa
ID: 7147132
Hi Now my code is...

Private Sub Command1_Click()
    Dim myCR As New CRAXDRT.Application
    Dim myRpt As CRAXDRT.report
   
    str_report_name = "TestODBC1.rpt"
    str_report_name = App.Path & "\" & str_report_name
   
    Set myRpt = myCR.OpenReport(str_report_name)
   
    With myRpt
      .Database.Tables(1).SetLogOnInfo "smcorptest", "Pubs", "test", "test111"
      .ReportTitle = rptTitle
    End With
   
    CRViewer1.ReportSource = myRpt
    CRViewer1.ViewReport
End Sub
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Author Comment

by:hmnpa
ID: 7162812
But I am not having crystal report s/w on my other m/c which is giving me this problem. So how can I set the location in report?
I did 'set location' on my test machine and moved over the production m/c as per the http://support.crystaldecisions.com/library/kbase/articles/c2011321.asp but when I am running over my test m/c its working fine but again when I am running over the production machine I am getting the same error.

even I have used "SetLogOnInfo" but still I am having problem...

Private Sub Command1_Click()
   Dim myCR As New CRAXDRT.Application
   Dim myRpt As CRAXDRT.report
   
   str_report_name = "TestODBC1.rpt"
   str_report_name = App.Path & "\" & str_report_name
   
   Set myRpt = myCR.OpenReport(str_report_name)
   
   With myRpt
     .Database.Tables(1).SetLogOnInfo "smcorptest", "Pubs", "test", "test111"
     .ReportTitle = rptTitle
   End With
   
   CRViewer1.ReportSource = myRpt
   CRViewer1.ViewReport
End Sub
Advice me...
0
 

Author Comment

by:hmnpa
ID: 7162814
But I am not having crystal report s/w on my other m/c which is giving me this problem. So how can I set the location in report?
I did 'set location' on my test machine and moved over the production m/c as per the http://support.crystaldecisions.com/library/kbase/articles/c2011321.asp but when I am running over my test m/c its working fine but again when I am running over the production machine I am getting the same error.

even I have used "SetLogOnInfo" but still I am having problem...

Private Sub Command1_Click()
   Dim myCR As New CRAXDRT.Application
   Dim myRpt As CRAXDRT.report
   
   str_report_name = "TestODBC1.rpt"
   str_report_name = App.Path & "\" & str_report_name
   
   Set myRpt = myCR.OpenReport(str_report_name)
   
   With myRpt
     .Database.Tables(1).SetLogOnInfo "smcorptest", "Pubs", "test", "test111"
     .ReportTitle = rptTitle
   End With
   
   CRViewer1.ReportSource = myRpt
   CRViewer1.ViewReport
End Sub
Advice me... what is the best way to combine a "seperate created crystal Report" and VB.

Reply ASAP
0
 
LVL 3

Accepted Solution

by:
ejiang earned 75 total points
ID: 7166359
Please try the followings:
1) I suppose that the "smcorptest" is your ODBC datasource, make sure that on the production machine, you can open up the ODBC Administrator, and test connection there it works fine;
2) Add one line of code:
With myRpt
    .Database.Tables(1).SetLogOnInfo "smcorptest", "Pubs", "test", "test111"
    .Database.Tables(1).Location = "database.dbo.tablename" '<- add this line
    .ReportTitle = rptTitle
  End With
replace database with the name of your data(pubs i suppose), and then replace the tablenme with the name of the table you report is created off; or if this sounds a bit confusing, you could open the report in Crystal Reports on the test machine, and then go to Database|Set Location, and in the TableName box, delete "database.dbo." and leave ONLY the tablename there, then bring the report to production machine, without above code change it should now works;
3) If above two still not working, I suggest you try one last thing:
With myRpt
    .Database.Tables(1).SetLogOnInfo "", "", "test", "test111" '<change this line to empty the first two parameters
    .ReportTitle = rptTitle
  End With

Hope this helps.
0
 

Author Comment

by:hmnpa
ID: 7196816
Hi Shahzad,
Can you please tell me what is the best way to run external crystal report Using VB?
I tried the above methods but still getting the problems when I am running over the production server.

hmnpa
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question