Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 19th, 2004, 08:15 AM
Authorized User
 
Join Date: Jun 2003
Location: Dhahran, Eastern Province, Saudi Arabia.
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.
Reply With Quote
  #2 (permalink)  
Old April 19th, 2004, 10:03 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
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
Reply With Quote
  #3 (permalink)  
Old May 3rd, 2004, 08:39 PM
Registered User
 
Join Date: May 2004
Location: Mexico, Mexico, Mexico.
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


Reply With Quote
  #4 (permalink)  
Old May 4th, 2004, 01:03 AM
Authorized User
 
Join Date: Jun 2003
Location: Dhahran, Eastern Province, Saudi Arabia.
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
Reply With Quote
  #5 (permalink)  
Old December 27th, 2004, 12:35 PM
Registered User
 
Join Date: Dec 2004
Location: Bangalore, KA, India.
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
Reply With Quote
  #6 (permalink)  
Old January 9th, 2005, 06:04 PM
Registered User
 
Join Date: Jan 2005
Location: Juiz de Fora, MG, Brazil.
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 07:16 AM
runtime error 20599 cannot open sql server francitaj Crystal Reports 3 October 4th, 2007 06:27 AM
Run-time error '20599'; Cannot open SQL Server manishashar888 Pro VB Databases 7 March 20th, 2007 08:04 AM
run-time error '20599' : cannot find sql server juicyfruit SQL Server 2000 1 February 16th, 2006 06:25 AM



All times are GMT -4. The time now is 09:28 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.