?
Solved

"Cannot Connect to SQL Server" Error when Running Crystal reports from VB6 program

Posted on 2006-06-28
11
Medium Priority
?
847 Views
Last Modified: 2012-06-27
We have a program written in VB6 that connects to a DB2 database and generates a crystal report based on user input.  The problems occurs after a new install, when the program attempts to write a crystal report, it gives the error message "Cannot Connect to SQL Server"  I believe the problem is somewhere in the .dll files that control crystal reports, but I do not know how to fix the problem.  The program does in fact connect to the DB2 database because it runs a SELECT statement on the database when the program starts.  There are several computers that the program runs fine on, so I know the connection string is correct.  Is there a tool I can use that wil make sure the correct .dll files are in place or is the problem somewhere else?

Thanks, Any help is greatly appreciated.
0
Comment
Question by:asubigsaxy
[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
  • 6
  • 5
11 Comments
 
LVL 42

Expert Comment

by:frodoman
ID: 17004611
What driver are you using to connect to DB2?  I've tried several but the only one that seems to actually work correctly most of the time is the Client Access drivers.  I suspect that what you're encountering is a specific error (user access privaledges, etc.) but the driver is returning a very generic message.
0
 

Author Comment

by:asubigsaxy
ID: 17010322
We install the DB2 (v7.2) Run-time Client that was provided by IBM to set up the DSN for the connection.  
0
 
LVL 42

Expert Comment

by:frodoman
ID: 17012882
There is more than one client but based on the version # I am guessing that this is the Client Express driver.  The first thing I'd check is if the computers that work have the same version of the driver as those that don't -- It's possible that the more recent version doesn't work the same way as the older ones.

If you have a standalone copy of Crystal, you might want to try running this report on one of the problem machines in the Crystal environment.  Sometimes you get a better error message there than you get coming back through an api.

frodoman
0
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

 

Author Comment

by:asubigsaxy
ID: 17042500
Thanks Frodoman,

The same driver is installed on each machine.

The crystal design enviroment is not installed on any of the problem machines, but I think our license would allow us to do that.  Something in the .dll files that fire up crystal reports must be messed up, but I dont really know much about how .dll files work.
0
 
LVL 42

Expert Comment

by:frodoman
ID: 17043038
>>> I think our license would allow us to do that.

Yea, as long as you aren't using your own copy at the time you should legally be able to install it and 'work' on another machine for a little while to see if you get a better error message.

You might just want to try reinstalling the dll files for Crystal (I assume you're using one of the merge modules to do it) - maybe something got corrupted there.  
0
 

Author Comment

by:asubigsaxy
ID: 17043254
The VB6 program installs the .dll files, but I am not familiar with merge modules.
0
 

Author Comment

by:asubigsaxy
ID: 17043502
Also, we use crystal reports 8.5
0
 
LVL 42

Expert Comment

by:frodoman
ID: 17045045
Can you reinstall the VB6 program or will that make a mess of things?
0
 

Author Comment

by:asubigsaxy
ID: 17045174
I have re-installed it many times on one machine, the program was written by my predecessesor, maybe some windows update created a file version problem, I've read that can cause the error -- but I am kinda clueless as to what .dll files are required for it to operate sucessfully --
0
 
LVL 42

Accepted Solution

by:
frodoman earned 1500 total points
ID: 17045395
That certainly could be the case - particularly if a newer dll was installed then when you reinstall the vb6 app it won't overwrite a newer dll with an older one.

You can try using the free FILEMON tool ( http://www.sysinternals.com/Utilities/Filemon.html ) while running the application.  It will show you all of the dll's that are accessed but you may have a lot to sift through unless you can isolate this application.  I'd stop everything else on the machine from running that you can before using FileMon.

0
 

Author Comment

by:asubigsaxy
ID: 17130655
The .dll driver the program was using was an old p2soledbc.dll  We rewrote the code to use a new p2odbc.dll -- The crystal report driver was getting the login info from the DB2 driver on the client machine, so only one user could correctly access the program.  The new .dll uses the windows login so that anyone who logs in can use the program.  I think it was developed way back in the day when there was only one user per computer.
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

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…
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 …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

771 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