Solved

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

Posted on 2002-07-10
7
512 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
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 …
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

691 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