Solved

stored procedure  parameters using vb6 , sql7 and crystal report 7

Posted on 2001-06-06
4
195 Views
Last Modified: 2010-05-02
when using stored proc. paramaters to fill the reports , i get the last saved data when the reports load, eventhough the options for discardsaveddata, and verify on everyprint ect. has been selected, the reports worked for a while and the all of the sudden started happening this problem , by the way i am are working with three projects that use the same reports but against diferent databases
0
Comment
Question by:todosunidos
4 Comments
 
LVL 1

Accepted Solution

by:
dalexis earned 200 total points
Comment Utility
The Crystal folks just don't get it when it comes to using stored procs.  If you've ever tried to get tech support from them on this problem you would quickly come to the same conclusion. :)

Anyway, one of the biggest problems with Crystal is that is stores the server/database info in the Report file, and you're out of luck trying to use the same report against different databases or servers by altering the settings in code.

You have to re-verify the database settings against each server/database from within the Crystal Reports Designer UI.

What you're probably seeing is not that you're getting previously saved data with each run of the report, but that it's always going against the server/database hard-coded in the Report file, rather than what you are setting thru code.

There is one way to fool it into doing what you want, and it involves having the Crystal Engine create a new DSN on the fly for the appropriate server/database connection using the LogOnServer method of the Print Engine.  Then you have to iterate through the Tables collection within the Report.Database object and reset the Location property with the database/table info.

Nasty stuff.  I lost quite a few hairs over geting Crystal to work.
0
 
LVL 3

Expert Comment

by:Joebob
Comment Utility
Why not have VB run the stored procedure and receive the recordset from the database?  You could then pass the recordset to Crystal and have it just display the results.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
Hi todosunidos@devx,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept dalexis@devx's comment(s) as an answer.

todosunidos@devx, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
Comment Utility
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

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