Solved

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

Posted on 2002-07-10
7
504 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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 …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now