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 SkipVought 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 1

Status
Not open for further replies.

timoteo

Technical User
Sep 17, 2002
72
0
0
US
I have VB application that manages a SQL Server 2000 database. I also use a CRViewer control to allow the user to view and change reports designed in Crystal Reports 7.0.

The reports display fine, however when a user clicks on the refresh button it displays the following error message: "Server has not yet been opened". I don't understand why because I open a connection to the SQL server in the standard code module using this code:

Sub main()

'Creates Connection
Set conSubscription = New ADODB.Connection

'Opens connection
conSubscription.ConnectionString = "Provider=SQLOLEDB.1;" & _
"Integrated Security=SSPI;" & _
"Persist Security Info=False;" & _
"Initial Catalog=Subscription;" & _
"Data Source = SERVER"

conSubscription.Open

frmMain.Show
End Sub

I think the problem might have something to do with SQL server authentication because when I refresh the report in Crystal Reports, it ask me logon before it will refresh.

Does anyone know how to pass that information on to Crystal Reports from VB?

I did alot research myself and found a good article here:

support.crystaldecisions.com/communityCS/ TechnicalPapers/cr_server_not_yet_been_opened.pdf.asp

But is is geared more to problems with ASP.

Does anyone have any idea what I am doing wrong?

Thank you in advance for any suggestion.


Timoteo
 
You recieve an error similar to this if you try and refresh a report that has been saved with data. Is your report a populated report, or is it a blank report which gathers data each time it is loaded? If the report is populated wiuth data, open it as a crystal report, and then choose to "save as", ensureing that the data is not also saved. Now when you open it within your application, it should refresh each time you click on the icon.

Hope this helps

BB
 
Before sending the report to the CRViewer, it needs login information to be able to connect:

rpt.Database.Tables(1).SetLogOnInfo "ServerOrDSNname", "DBName", "UserID", "Password"

This document has some good information on the different methods to connect to data sources using the RDC.

-dave
 
Thanks for the suggestion BiggerBrother, but I was not able to get it to work using "save as".

vidru, you were right on with your suggestion.


Thanks to the both of you for taking the time to post.


Timoteo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top