×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Error "Server has not yet been opened"

Error "Server has not yet been opened"

Error "Server has not yet been opened"

(OP)
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.

RE: Error "Server has not yet been opened"

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"




RE: Error "Server has not yet been opened"

(OP)
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

RE: Error "Server has not yet been opened"

===========================================================
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.

RE: Error "Server has not yet been opened"

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.

RE: Error "Server has not yet been opened"

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.

RE: Error "Server has not yet been opened"

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









RE: Error "Server has not yet been opened"

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.

RE: Error "Server has not yet been opened"

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

RE: Error "Server has not yet been opened"

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close