Visual basic 6 sqlquery method to crystal reports 4.6 being ignored???

Posted on 2007-07-25
Last Modified: 2008-01-09

I have installed my program at a sister company. Everything works as expected except for some crystal reports.
A dynamic query is created in visual basic 6 and passed on to crystal reports.
e.g. crydo.sqlquery = "SELECT * from prints where filenr = 12345"
This works fine at my office, but here it doesn't want to work.
When I set a break point to cut n paste the query into query analyzer, it works fine.

In my office where use Windows Authentication and here I have to use SQL Authentication.
Both offices use ODBC connection for crystal reports data.

The server is running Windows 2003 SP2 with MS SQL 2000 SP4. Nothing else is running on this server.
All workstations are running XP SP2, fully up to date.

Any idea's?
Question by:DennisPost
    LVL 3

    Expert Comment

    do you get any error or you get the report blank

    please check the report which you have installed is not readonly
    LVL 2

    Author Comment

    Hi RajendraDewani,

    I pass a query to the crystal report that specifies one file only.
    When the report is finished loading all reports are loaded. The user then has to find their file anmongst all the rest.
    Also before the user can find their file they must first open crystal reports to refresh the data.
    Only then will it show up via the visual basic application.

    The odbc is using sql authentication.
    I am in the process of creating a workgroup network at the moment to experiment a bit more.
    LVL 2

    Author Comment

    Turns out I just needed to add one extra line.

    cryDO.Connect = "DSN=TestDSN;UID=TestUser;PWD=TestPWD;DSQ=TestDB"
    LVL 17

    Expert Comment

    by:Shanmuga Sundaram
    Hi RajendraDewani,

    Can you please let me know whether you are using crystal report during runtime with any of the applications like VB? or you are executing the report as a stand alone. Before that I hope that my sugessitions will be helpful to you for solving your problem?.

    If you are using crystal report as a stand alone application, then at the design window of the crystal report application in the "File Menu" -> "Save" option you can find a check box which will have the text similar to  "Save report with data"  (Please note that currently I have not crystal report installed in my machine) will be available. Here if you disable the checkbox and then save your report design, i hope that the problem of  refreshing the data while opening the report will be solved. Hope this might help you

    D.Shanmuga Sundaram
    LVL 2

    Author Comment


    Thanks for the tip.

    In VB the reports are called up from a local folder. The query for the report is dynmically generated in the VB app. (I think this is what you mean by standalone...??)

    Please note that I have requested to close this question as my previous comment has the answer.

    Thanks for your time anyway.
    LVL 1

    Accepted Solution

    Closed, 500 points refunded.
    Community Support Moderator

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    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.
    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…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    779 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

    13 Experts available now in Live!

    Get 1:1 Help Now