Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
.SQLQuery for Crystal Reports doesnt work?!
Message
From
02/10/1998 07:15:27
Frixos Kimonis
The Clancy Group / Dowcra
Harefield, United Kingdom
 
 
To
All
General information
Forum:
Visual Basic
Category:
ActiveX controls
Title:
.SQLQuery for Crystal Reports doesnt work?!
Miscellaneous
Thread ID:
00143153
Message ID:
00143153
Views:
64
I have read the help file concerning the

.SQLQuery

and understand that you can only change some parts of an initial query.

Heres my prob though...

I have created a query table in ACCESS and have imported it into CRW.
I have inserted database fields( from the query )
into the report. I then run the report through VB with the

.ReportFileName    property
.Password          The db is protected.
.Destination
.Action = 1
etc...

This runs fine, and I get the report up with all my db fields filled in
correctly.

But when I wish to change the query, with the .SQLQuery property,
the same amount of records are produced. (The query does not seem to be
working.
and I get no error messages)

The initial query is :

SELECT  [Supplier Master].[Supplier Name],
[Supplier Addresses].[Address 1] ,
        [Supplier Addresses].[Address 2],
        [Supplier Addresses].[Address 3],
        [Supplier Addresses].[Address 3] ,
        [Supplier Addresses].[Address 4],
        [Supplier Addresses].[Post Code],
        FROM [Supplier Master]
        INNER JOIN
        [Supplier Addresses]
        ON
         ([Supplier Master].[Supplier Code] =
         [Supplier Addresses].[Supplier Code])
         AND ([Supplier Master].[Account Type] =
         [Supplier Addresses].[Account Type]);

which  returns me all suppliers addresses and names.
This works find. But when I use .SQLQuery to change the query
so I just get Suppliers with a type 'S' account, I get the same result.

The change is that I add another AND statement at the end of the initial
query
......
.SQLQuery = "SELECT [Supplier Master].....
     .......AND ([Supplier Master].[Account Type] =
     [Supplier Addresses].[Account Type]
added     ->>>>  AND [Supplier Master].[Account Type] =""S"");

I have ran this query in ACCESS by just adding
the extra bit at the end and it works with no errors.
I have also changed  in the Report Settings and unselected the 'Save data
with report option'
just incase you were wondering :)

Any ideas?


Thanks in Advance
Next
Reply
Map
View

Click here to load this message in the networking platform