... objCrystalReport.SqlQuery = "SELECT * FROM tblPartMaster WHERE PartNum = '1b2bb3bbb4bbbb'" ...
What actually makes it to Crystal Reports is this ...
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?
This post has been edited by gklocek: 29 July 2008 - 03:59 PM