I am having problems with an older application designed in VB6 that uses Crystal Reports V6 and V7. When I pass a SQL Query command to Crystal Reports OCX v6 or v7 like this (where 'b' is a Blank Space) ...
CODE
...
objCrystalReport.SqlQuery = "SELECT * FROM tblPartMaster WHERE PartNum = '1b2bb3bbb4bbbb'"
...
What actually makes it to Crystal Reports is this ...
CODE
SELECT * FROM tblPartMaster WHERE PartNum = '1b2b3b4b'
The Crystal Report OCX is stripping excess consecutive SPACES from the entire SQL Query Command. That is great except it should not be stripping any consecutive spaces from inside the SINGLE QUOTED STRING LITERAL. This makes the WHERE Clause fail only for certain new Part Numbers that now have consecutive spaces in them. The PartNum is actually appended to the VB6 String just before the Crystal Report is activated but was shown here as a constant just for clarity purposes. The Crystal Report works perfectly if there are not consecutive spaces in the Part Number but it selects no Part Number if there are consecutives spaces in the Part Number.
Is this a known bug?
Is there Crystal Setting that I can change to fix this?
Thank You,
This post has been edited by gklocek: 29 Jul, 2008 - 02:59 PM