Solved

Problem printing Crystal Report from VB - Run Time Error 20599

Posted on 2003-11-17
7
2,170 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 42

Accepted Solution

by:
frodoman earned 50 total points
Comment Utility
0
 
LVL 42

Expert Comment

by:frodoman
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 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

16 Experts available now in Live!

Get 1:1 Help Now