?
Solved

Problem printing Crystal Report from VB - Run Time Error 20599

Posted on 2003-11-17
7
Medium Priority
?
2,207 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 42

Accepted Solution

by:
frodoman earned 150 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

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