Solved

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

Posted on 2002-07-10
7
507 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal Reports Date Formula Failure 26 116
What is the best report viewer for Crystal Reports in ASP.Net using vb.net/C# 2 104
Crystal Report detail 15 49
Crystal Reports 2013 25 35
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 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