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 Chris Miller 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.

Status
Not open for further replies.

JuanJulio

Programmer
Nov 11, 2003
3
US
I have a table in SQL server populated with the information I need. It is referenced by a stored procedure. I cannot figure out what is causing this error. Any help would be great.
 
How are you calling the report? From within Crystal Reports? From a vb app? On the web?
 
I am calling it from a VB application. It errors when I call the printout method.
 
Ok, you need to use either the applicaton LogOnServer method or the Database Table object's SetLogonInfo method. Some sample code for the SetLogonInfo is shown below. Use the SetLogonInfo before calling the printout method:

Dim crApp as New CRAXDRT.Application
Dim crRpt as CRAXDRT.Report

Set crRpt = crApp.OpenReport("myreport.rpt")


Set crDB = crRpt.Database
Set crTables = crDB.Tables



For Each crTable In crTables
'For a native connection, SetLogOnInfo arguments are ServerName, DatabaseName, UserName, and UserPassword
crTable.SetLogOnInfo "dell-laptop", "Northwind", "green", "password"
'For an ODBC connection, SetLogOnInfo arguments are ODBC ConnectionName, DatabaseName, UserName, and UserPassword
'crTable.SetLogOnInfo "Northwind", "Northwind", "green", "password"
Next

Use the appropriate syntax for your connectivity (ODBC, native). If you're using OLEDB, you'll need a different syntax as well. It's helpful if you mention your connectivity and Crystal version number in your posts.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top