Solved

Problem printing Crystal Report from VB - Run Time Error 20599

Posted on 2003-11-17
7
2,180 Views
Last Modified: 2007-12-19
I am using Visual Basic 6.0 to connect to a Crystal Report through the Crystal Report control crystl32.oxc.  The report was generated in the 32-bit Crystal Report Designer in Crystal Reports 6.0 and connects to an Access 2000 database.  

The Crystal Report Control is setup to connect to the report (ReportFileName = "C:\Database\matdata.rpt") and to print to the window (Destination = 0).  All other parameters are set to default.

A command button is used with the single command:
CrystalReport1.Action=1

This originally worked, but the database was not being updated.  I read that I needed to change the "Save data with report" option to be unchecked in order for the data to be updated.  I unchecked this option and saved the report.

Now when I run the program and call the above print command, I get the following error:

Run-time error '20599':
Cannot find SQL server.

I'm not sure if this is a problem with the way that I am creating the report or with how it is being called from VB.

Please advise.
0
Comment
Question by:pjpruitt
7 Comments
 
LVL 13

Expert Comment

by:EwaldL
ID: 9766449
are you getting this on your development machine with the full cr 9 install? if so, then open the report in the cr designer, hit "database" -> "verify database". Now refresh the report and save the .rpt without saved data. Can you now view the report through your application? Should this fail, is there a password on the access database?
0
 
LVL 42

Expert Comment

by:frodoman
ID: 9766620
You're getting a SQL server connection when connecting to Access 2000?  Assuming your db connection isn't completely hosed, I suspect that you have an instance of Access which has linked / imported tables from SQL Server?  

If that's correct, the problem is more likely that your connection from Access to SQL server has broken - probably not a problem with the C.R.  Open Access and fix your link and that should solve the problem...
0
 

Author Comment

by:pjpruitt
ID: 9767198
I can verify the database, and there is no password associated.  I still get the same error.

The db connection is fine.  I am connecting to the same database through vb to fill in info on forms.  All of my tables in Access are local within the same database.  Nothing is linked/imported.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 42

Accepted Solution

by:
frodoman earned 50 total points
ID: 9767250
0
 
LVL 42

Expert Comment

by:frodoman
ID: 9767258
This one also:

http://support.crystaldecisions.com/library/kbase/articles/c2006655.asp


Both links are talking about CR 7 & 8, but possibly the same problem exists in your version as well.
0
 
LVL 13

Expert Comment

by:EwaldL
ID: 9767394
try creating a new report, adding one single table though the option "Database Files" in the data explorer. Then place only one single integer field on the report. can you view this report now with the option "save data with report" unchecked. Should this still fail then hit "Database" -> "Convert Database Driver". This will list a "pdb*" dll. This file should NOT exist on your machine. Instead replace the second character (the "d") with a 2 and search for this file. If you are finding duplicates, then rename the older versions of that file.
0
 
LVL 1

Expert Comment

by:Krelek200
ID: 9767977
Did you declare your database in your Visual Basic program?  It could be that it is trying to look up nothing, and that is causing the error.
Here is a bit of code for you:

For i = 1 To report.Database.Tables.Count
        report.Database.Tables(i).SetLogOnInfo DSNname, Server, UserID, password
Next i

Specify a datasource using the Datasource Administrator and this should help you stop the SQL Error.

Krelek
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question