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!

Error "Server has not yet been opened"

Status
Not open for further replies.

janakrajani

Programmer
Dec 5, 2001
9
US
I am using VB 6.0 and SCR 8.0.

From VB6.0, I am referencing SCR 8.0.

Now when I hit DISPLAY REPORT from the VB form, I get the following error :

Run-time error -2147192184(80047288): 'Server has not yet been opened'.


My code is as follows :
=================================================
Dim crxApplication As New CRAXDRT.Application
Dim crxReport As New CRAXDRT.Report

...
...

'logon the server to get the report data
crxApplication.LogOnServer "P2ssql.dll", "server", "dbname", "user_id", "pwd"
'open the report
Set crxReport = crxApplication.OpenReport(App.Path + ("\Deny.rpt"))
'pass the value of parameter from VB to SCR
crxReport.ParameterFields.Item(1).AddCurrentValue (Val(txtYear.Text))
'pass the value of the second parameter from VB to SCR
crxReport.ParameterFields.Item(2).AddCurrentValue (Val(txtRegionNum.Text))
'set the report source
CRViewer1.ReportSource = crxReport
'finally display the report
CRViewer1.ViewReport
========================================================

Can anyone tell me where I am wrong ?

Please treat this as urgent....

Thanks in advance.
 
I usually use the .LogonServer method under the CRAXDRT.Report object:

Set crxReport = crxApplication.OpenReport(App.Path + ("\Deny.rpt"))
crxReport.Database.LogOnServer "P2ssql.dll", "server", "dbname", "user_id", "pwd"




 
The method that you have suggested me to use is also NOT working. However, I tried exploring new ways, and I came to know that the steps that I had followed were correct. The only thing was that the client machine requires MS SQL SERVER 7.0 CLIENT installation on it.

By doing this, my problem is solved. But in any case, I really appreciate the reply that you have sent to me. Thank you once again.

Janak Rajani
 
===========================================================
Dim Appl As New CRAXDRT.Application
Dim Rep As New CRAXDRT.Report

Dim strReportDir As String
strReportDir = App.Path & "\RMSApp.rpt"
Set Appl = CreateObject("CrystalRuntime.Application")
Set Rep = Appl.OpenReport(strReportDir)
Rep.Database.Tables_(1).SetLogOnInfo "Server", "Table", "User", "Pass"

Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Rep
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
==========================================================
I used the above code and it worked on my machine.
 
Sorry should have previewed first it should be

=========================
Rep.Database.Tables(1).SetLogOnInfo "Server", "Table", "User", "Pass"
============================================
Even though it seems as though you are only gaining access to one table it allows me access to all the tables in my database.
 
Even though you have logged on to the Server. You still need to set location for all the tables which have been used in the report.
So set the location for each table or view used at run time.
 
HELP!!!!!!

I have tried numerous examples and even tried my own variation, but no luck. I keep on getting the same old tiring message: "Server has not yet been opened.'

Here is some of my code:

Dim rdApp As CRAXDRT.Application
Dim rptSource As CRAXDRT.Report
Dim crpParamDefs As CRAXDRT.ParameterFieldDefinitions
Dim crpParamDef As CRAXDRT.ParameterFieldDefinition

Set rdApp = CreateObject("CrystalRuntime.Application")
Set rptSource = rdApp.OpenReport(sReport)
rptSource.Database.LogOnServer "p2sodbc.dll", "StockTakeSql", "", "", "Stocktakesql1"

.
.
.
.
CRViewer1.ReportSource = rptSource
CRViewer1.ViewReport









 
rptSource.Database.LogOnServer "p2sodbc.dll", "StockTakeSql", "", "", "Stocktakesql1"

I doubt this would work. The last 2 parameters are username and password. You're saying that you have a blank username with a password of "Stocktakesql1".

Since the 3rd parameter is blank, the 2nd parameter must be a DSN. And the DSN is case-sensitive. Hopefully that part is correct.
 
Man, I hope you guys can help. I've been reading this page looking for assistance.

I, too, am trying all the above examples and I keep getting the same error. I'm using Delphi, and my code is as follows:

Report := crApp.OpenReport(ReportFileName, crOpenReportByTempCopy);
Report.Database.Tables[1].SetLogOnInfo(DataDir, TableName, '', '');
crView.ReportSource := Report;
crView.ViewReport;

It seems to me that the Crystal report will simply NOT run unless you've connected it to an ODBC... correct?

My application does not have an ODBC and I'd prefer not to create one. My report requires only 1 table to read from.

Any advice appreciated,
Todd
 
EUREKA!!

I changed my driver from "p2sodbc.dll" to "pdssql.dll" , installed SQL Client on the machines and copied ntwdblib.dll to the system32 folder.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top