SQLQueryString and SQL Server from Vb6 using CR9 RDC
Below is a snippet of my code:
myReportObj.Database.LogOnServer "crdb_odbc.dll", "myODBC-DSN", "myMSSQL-DB", "mySQLServerUserID", "mySQLServerPWD"
myReportObj.SQLQueryString = mySQLString
Why is Crystal (Vb6 with CR 9.0 RDC) generating the report with all the records in the myMSSQL-DB.table INSTEAD of ONLY the records that are restricted with the WHERE clause in the above (mySQLString).
The records are being pulled from a predefined VIEW on the SQL Server 2005.
The SQL Server 2005 VIEW is made up of two tables.
mySQLString is something like: SELECT name, amount, street FROM myMSSQL-DB.table WHERE name="john".
However, when the report gets generated, I get the records for John and ALSO those for Paul on the report.
When I tell the program/report to use MS ACCESS database instead of SQL Server 2005, everything work just fine. The report generates with ONLY records for John like it should.
Where should I begin to look to have this resolved? Doesn't SQLQueryString work with SQL Server 2005?
I have lots of CR Report (VB .DSR) that have always worked fine using MS ACCESS, I am now try to migrate to SQL Server 2005 as datasource (hopefully with as MINIMAL changes as possible), but just have lots of problems here and there!
Thanks All in advance.