?
Solved

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

Posted on 2006-06-28
11
Medium Priority
?
853 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
  • 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Loops Section Overview
Suggested Courses

864 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