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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB & Server has not yet been opened

Status
Not open for further replies.

PauloMongo

Programmer
Jul 16, 2001
80
GB
Help.

I am trying to run a report against an Oracle database using VB 6. I use the following code

Dim appl As New CRAXDDRT.Application
Dim report As New CRAXDDRT.report


Private Sub Form_Load()
report.DiscardSavedData
Set report = appl.OpenReport("c:\test.rpt")

For i = 1 To report.Database.Tables.Count
report.Database.Tables(i).SetLogOnInfo "Service Desk", "ovsd4", "system", "manager"

Next i

CRViewer1.ReportSource = report
CRViewer1.ViewReport
End Sub

When I run the report I get the following error


"Server has not yet been opened"


Any ideas
 
There are numerous things that can result in the dreaded 'Server has not yet been opened' message. Crystal even have a document that steps you through resolving the problem (it's nearly always a problem with the database access). Go to Crystal's support document website ( and search for a document titled; cr_server_not_yet_been_opened.pdf
 
Hi Thanks,

I have tried this but with no joy. If I connect to a local database to the machine then it works fine, if I connect to a database on a server then here lies the problem. Is there anyway in which I can test the connection to the database?
 
the error is in the setlogoninfo.
you can use report.Database.Tables(i).SetLogOnInfo "connection string"

or

report.Database.Tables(i).SetLogOnInfo
"Provider=SQLOLEDB.1;Persist Security Info=True;Data Source=Service Desk", "ovsd4", "system", "manager"

 
I have tried both methods and still I get the same error. I have looked at your first solution and the method is the same as mine, am I reading this wrong?

Is there something else I have to do.


Thanks in advance,

Frustrated Paul
 
I have used the following and it prompts me for my username/password, once entered the report runs.

report.Database.Tables(i).TestConnectivity.

How did you find the following out for the servername.

"Provider=SQLOLEDB.1;Persist Security Info=True;Data Source=Service Desk"



 
if you use ADO connection in your report it works. it works for me even if switch from one server to another. just use ini file if you like to change server at run time.

i did not try the test connectivity. just try to use it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top