Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 19th, 2004, 07:15 AM
Authorized User
 
Join Date: Jun 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error 20599 Cannot open SQL Server

I have been trying to browse a Oracle based Crystal Report with following VB code:

 CrystalReport1.DiscardSavedData = 1
 CrystalReport1.ReportFileName = "C:\Report1.rpt"
 CrystalReport1.Action = 1

I am using crystal report control. The database of the report is ODBC datasource connecting to oracle. Without DiscardSavedData this works, but displays old data. With DiscardSavedData, I get the error message - Error 20599 Cannot open SQL Server. Can anyone help me to solve this problem.
 
Old April 19th, 2004, 09:03 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What is the recordsource for the report? I am taking a stab at it, but i think that the report is probably set to a SQL Server database connection and not Oracle.

Probably did not help much.



Sal
 
Old May 3rd, 2004, 07:39 PM
Registered User
 
Join Date: May 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This problem occurs when you try to open a crystal report and you have not connected properly.

Use this line of code.

CrystalReport1.Connect = "Data Source=Localhost;UID=username;PWD=password;DSQ=Dat aBaseName;"

If you are using DSN repleace like this

CrystalReport1.Connect = "DSN=Name_Of_Your_Connection;UID=username;PWD=pass word;DSQ=DataBaseName;"

*******************************SPANISH************ *****************
Este error sucede porque en Crystal Reports no podemos grabar el usuario y password en el reporte ni siquiera en el control, así que necesitamos usar la siguiente linea de código

CrystalReport1.Connect = "Data Source=Localhost;UID=username;PWD=password;DSQ=Dat aBaseName;"

Si usas DSN

CrystalReport1.Connect = "DSN=Name_Of_Your_Connection;UID=username;PWD=pass word;DSQ=DataBaseName;"

SALU2
See you


 
Old May 4th, 2004, 12:03 AM
Authorized User
 
Join Date: Jun 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Salu2,

I was able to solve the problem by supplying the Password (PWD) in the LogonInfo(n) properties of the Report. Other Connect parameters (database name, user id, etc.) are in the report file.

Regards

Niaz
 
Old December 27th, 2004, 12:35 PM
Registered User
 
Join Date: Dec 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to syncin Send a message via Yahoo to syncin
Default

dear niaz
im stuck with the same problem, i have even set the connect property but still getting the error, "cannot open sql server", can u please give me the exact piece of code you used that solved your problem.
thanks in advance
syncin

Kamal
 
Old January 9th, 2005, 06:04 PM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to emidio_nasc
Default

Hy!

I've the same problem, but with some diference.

My stuff:
3 W2K Servers with MS SQL Server
25 Win98se with Setup VB6 and my program
1 XP (SP1) with Setup VB6 and my program

I've this message only in the XP machine, after more less 2 hours working!!!!

Then, I need to reboot the machine and this message will show again after more less 2 hours and again and again...

Only the Crystal Reports stop working, but other functions stay working normally.

And more! I've installed the Crystal Reports Design 8.0 in this XP machine and after that 2 hours, the Crystal too can´t connect to the server!!!

Do anybody know what is happening??? :D

Emidio Nascimento





Similar Threads
Thread Thread Starter Forum Replies Last Post
20599 - Cannot open SQL server Anup Gavate VB Components 2 March 5th, 2009 04:49 AM
20599 - Cannot open SQL Server itsviji4u SQL Server 2005 0 November 3rd, 2007 06:16 AM
runtime error 20599 cannot open sql server francitaj Crystal Reports 3 October 4th, 2007 05:27 AM
Run-time error '20599'; Cannot open SQL Server manishashar888 Pro VB Databases 7 March 20th, 2007 07:04 AM
run-time error '20599' : cannot find sql server juicyfruit SQL Server 2000 1 February 16th, 2006 06:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.