Solved

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

Posted on 2002-07-10
7
505 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 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

20 Experts available now in Live!

Get 1:1 Help Now