Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Server has not yet been opened" error using RDC LogOnServer function

Status
Not open for further replies.

Tungsten

Programmer
Nov 15, 2001
3
US
Hi all,
Using Crystal 8.5 I am trying to load reports stored as RDC reports in my VB6 project to be viewed in a CRViewer on a form. I have successfully loaded these reports from .rpt file format but the company I work for wants them built into the project.

When I run the project I get a "Server has not yet been opened" on the line:

CRReport.Database.LogOnServer "PDSOLEDB.DLL", "SERVER", "DATABASE", "USERNAME", "PASSWORD"

It is my understanding that LogOnServer opened the server but I seem to be mistaken. Any help is greatly appreciated
 
Ok, that helped a little as in I don't get the error on the same line. Now the same error, along with a bunch of blank errors, occurs on the line with:

CRViewer1.ViewReport

The whole of the code is basicly as follows:

Private Sub cmdView_Click()
'There is a Crystal report designer called CRReport in the project.

While Count < CRReport.Database.Tables.Count
CRReport.Databas.Tables(Count +1).SetLogOnInfo <logoninfo>
count = count +1
Wend

CRViewer1.ReportSource = CRReport
'When stepping through the code the ReportSource still = Nothing at this point. I am wondering if this is causing the problem but don't know how to fix it.

CRViewer1.ViewReport 'Error occur here

End Sub

This is almost right out of the book but it still does not work.
 
So you have a:

Dim CRReport as New CrystalReport1
^^^ (or whatever your .DSR is called)

And you've got a command button on a VB form and you have the viewer on the same form?
 
Yep. It's just my test project/form to see if I can get it working in the product.
 
Something's not right, regardless of connecting to the server.

If you've done the: Dim CRReport As

Then anywhere in the cmdView() code you should be able to do a CRReport.Name and see the name of the report, as well as examine some other properties as well.

If CRReport is Nothing then it's not connecting to the .DSR file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top