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!

Problems connecting to SQL Server with VB for Crystal Reports 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Using SQL Server 7, Crystal Reports 8 and VB 6. Have designed some reports using Crystal, and am trying to link them into a VB app. When I try to call up the form (with the report attached), it gives me a "Server has not yet been opened" error. How do I go about opening the server? I've tried

Dim Report As New CrystalReport1

Report.Database.LogOnServer "pdssql.dll", "Server", "Database", "UserID", "Password"


I've also tried

Dim Report As New CrystalReport1

Report.Application.LogOnServer "pdssql.dll", "Server", "Database", "UserID", "Password"


Is there something else I need to do? Is there help on this somewhere?

Thanks.
 
Does the report use a DSN or is it directly to the server? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
I just ran into similar problems this morning - I found out that the database name had to be qualified - eg

finance.dbo

please note however I was using a DSN.
 
I'm using the following syntax for SetLogOnInfo:

Dim rpt As CRAXDRT.Report

' other code ....

rpt.Database.Tables.Item(x).SetLogOnInfo "Server", "Database", "username", "password"

This works for me for connecting to the SQL Server. However, when I try and refresh one of my reports that has subreports, I get the "Server has not yet been opened" error....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top