I get SQl error 42P01while executing a Sql query in Crystal Reports XI

Posted on 2009-02-10
Last Modified: 2012-05-06
I am trying to create a report through SQL in crystal reports XI and the databass is postgresSQL, but I get an error:
Failed to retrieve data from the database.
Details: ADO Error Code: 0x80004005
Source: Microsoft OLE DB Provider for ODBC Drivers
Description: ERROR: relation"tablename" doesnot exist;
error while executing the query
SQL State: 42P01
Native Error" 7 [Database Vendor Code:7]

The query runs fine, when I run it through Postgres studio.

I would appreciate if somebody could help me with this issue
Question by:ReddyUD
    LVL 100

    Expert Comment

    What is the query?

    How are you adding it to the report?


    Author Comment

    below is the query:
    SELECT "aoadorder"."adordernumber", "aoadorder"."id", "ss_adorder"."discountcodeid"
     FROM  "aoadorder" "aoadorder" INNER JOIN "ss_adorder" "ss_adorder" ON "aoadorder"."id"="ss_adorder"."adorderid"
     AND "ss_adorder"."discountcodeid" ='2'

    I selected "create new connection" then "OLE DB (ADO)" then my database and clicked on "add command" where I wrote the above sql query.
    And the database is PostGres

    Thank you
    LVL 100

    Accepted Solution

    Try taking the " out.


    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    Best database to use for Maps is PostgreSQL. This is an open source database. Comes as a package with most Linux OS. For more info visit the following site: ( This requires some add-o…
    I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
    Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    755 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

    17 Experts available now in Live!

    Get 1:1 Help Now