Solved

Using crystalreport.SelectionFormula (in VB6) on CR based on an Oracle view, but getting error:"The field name is not known".

Posted on 2006-07-14
6
745 Views
Last Modified: 2012-06-27
I'm able to filter reports from by VB6 app, calling prepared crystal reports that are built from Oracle tables, but when I try to fitler on a view, I get the error "The field name is not known." Thank you for your help.
0
Comment
Question by:briankam
  • 3
  • 2
6 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 17113068
What do you mean filter on a view?

mlmcc
0
 
LVL 17

Expert Comment

by:MIKE
ID: 17116438
When you say FILTER on a VIEW...does that mean you are trying to use the SELECT CRITERIA....or a PARAMETER FIELD...in order to filter?

It appears that the VIEW is setup with different filed names than what the prepared report is setup with. The VIEW may not even be the same data as in the prepared crystal reports.

MikeV
0
 

Author Comment

by:briankam
ID: 17121772
When creating the report in Crystal, when selecting the Database, I selected More Data Sources/Active Data/Active Data (ADO) and write "Select * from rept_18" (which is the name of my view in Oracle) in the SQL window, and used the fields to create the report. In my vb6 code I'm trying to use: Form1.CrystalReport1.SelectionFormula = "{select_code} = '" & sel_code_filter & "'" to filter on the 'select_code' field. I've tried many prefixes inside the {}s, such as {rept_18.select_code}, {databasename.rept_18.select_code}, etc., but still getting the error when trying to run report from vb. The field name in the view is the same as in the data table. Thank you.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 17

Accepted Solution

by:
MIKE earned 250 total points
ID: 17122702
BrianKam:

Try typing out the entire data table location:

ie.  
SELECT *
FROM servername.dbo.rept_18

0
 

Author Comment

by:briankam
ID: 17124378
I was only able to enter SELECT * FROM rept_18 in Crystal, but since I defined it as an ADO database, I added the prefix 'ado.' in the VB6 statement: CrystalReport1.SelectionFormula = "{ado.select_code} = '" & sel_code_filter & "'" and it worked. Thanks for the help, it led me to the final answer.
0
 
LVL 17

Expert Comment

by:MIKE
ID: 17124390
BrianKam:

I'm glad to be able to help out.

MikeV
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

867 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

23 Experts available now in Live!

Get 1:1 Help Now