Solved

stored procedure  parameters using vb6 , sql7 and crystal report 7

Posted on 2001-06-06
4
198 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
ID: 6161353
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
ID: 6161588
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
ID: 7133357
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
ID: 7167820
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA open file from excel cell 4 42
to transfer string from C lanaguage to VBA 4 64
Child Form in front 4 46
Create Files based on Cell Values in a Range in Excel 12 37
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

785 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