Solved

Problem printing Crystal Report from VB - Run Time Error 20599

Posted on 2003-11-17
7
2,176 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

919 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now