Crystal and parametrized queries 
Author Message
 Crystal and parametrized queries

Hi, all

Could anybody help me with this question:
A Crystal Report is built against a query in an MDB database. I need this
query to have a parameter. I am running the report from VB application,
using Crystal Report OCX control.
Is it possible to pass parameters to the query? The property
StoredProcParam does not help, apparently it only works with stored
procedures in ODBC data sources.

Any help is greatly appreciated. Thanks in advance.

Arthur Medzhitov



Mon, 13 Nov 2000 03:00:00 GMT  
 Crystal and parametrized queries

I had a similar problem recently, and solved it by setting up a reference to
the mdb in the ODBC administrator.
You still write your query in Access, with the following line preceding the
SELECT statement:

PARAMETERS VAR1 string, VAR2 string;
SELECT * FROM TABLE1 WHERE...;

Then in your VB code:

REPORT1.Connection = "DSN=the name you gave the database in ODBC
administrator;...."
REPORT1.StoredProcParam(0) = parameter1
REPORT1.StoredProcParam(1) = parameter2

in your VB code.

Hope this helps.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Quote:

>Hi, all

>Could anybody help me with this question:
>A Crystal report is built against a query in an MDB database. I need this
>query to have a parameter. I am running the report from VB application,
>using Crystal Report OCX control.
>Is it possible to pass parameters to the query? The property
>StoredProcParam does not help, apparently it only works with stored
>procedures in ODBC data sources.

>Any help is greatly appreciated. Thanks in advance.

>Arthur Medzhitov




Mon, 13 Nov 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Executing parametrized queries in ADODC component

2. SQLBase, ODBC and Parametrized Queries

3. Parametrized create table query

4. Parametrized SQL-queries with ODBC interface

5. Parametrized Query with Optional TOP Predicate

6. VB crashe when calling parametrized query within dataEnvironment

7. calling Parametrized Access 2000 query

8. Parametrized Query

9. VB/ADO parametrized queries

10. HELP: Parametrized union queries don't work with Jet 4.0

11. parametrized query

12. SQL query works, Crystal query doesn't

 

 
Powered by phpBB® Forum Software