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
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.
Question by:briankam
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 100

Expert Comment

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

LVL 17

Expert Comment

ID: 17116438
When you say FILTER on a VIEW...does that mean you are trying to use the SELECT CRITERIA....or a PARAMETER 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.


Author Comment

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.
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

LVL 17

Accepted Solution

MIKE earned 250 total points
ID: 17122702

Try typing out the entire data table location:

FROM servername.dbo.rept_18


Author Comment

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.
LVL 17

Expert Comment

ID: 17124390

I'm glad to be able to help out.


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

697 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