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!

Calling a CR ver 8.5 which connects to SQL-Server

Status
Not open for further replies.

moben

IS-IT--Management
Feb 5, 2002
116
0
0
GB
I have a simple VB6 application which call (allows the user to view reports within Crystal Reports 8.5).

These reports obtain data from tables contained upon a SQL-Server 2000 database. During design it was ok to login to SQL-Server.

When attempting to run the reports from VB6 I am getting a run-time error 20599 - Cannot open SQL-Server.

Could anybody help with the syntax required to open this SQL-Server database, so that I can preview the reports in CR.

Many thanks,

moben.
 
Hi Joe,

All I have is one form with some 2 menu options to run the reports. Upon clicking one of these, the following code is run:

frmLogon.RptRecs.ReportFileName = gx_path & "Report.rpt"
frmLogon.RptRecs.Action = 1

The report nearly views, but then it gives the "Cannot open SQL server" error msg.

I need to connect to the SQL-Server, but not sure of the correct syntax.

I am only using VB6 as it allow me to create a form for the users, and allows distribution of Crystal Reports without the need for having a full blown Crystal Report installtion on that users machine.

Any help greatly appreciated.



 
What version of crystal reports did you create the report in?
What (crystal) classes are you using to run the report.
Does the report use a DSN?
Does the report run properly on the machine you are trying to run it on with vb6?
What is RptRecs? Is that all the code you use to run the report?

Please show everything related to running the report.

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 
1. I'm using Crystal Reports 8.5
2. I've added a CR object called RptRecs from the VB6 toolbox onto my single form.
3. The report runs ok on my machine within the CR environment.

Hope this helps ?
 
What references do you use for the CR object?
Does the report use a DSN?

"I think we're all Bozos on this bus!" - Firesign Theatre [jester]
 

The report probably works on the developing machine because the needed logon info, table location, etc, or DSN [name, is stored in the rpt which is identical to the the information on the developing machine.

For other machines you need to set the LogOnServer or LogOnInfo properties.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top