sniles
asked on
MFC App works with MS SQL Server; under Oracle get errors in SQL query strings
My MFC application functions perfectly when run against SQL Server (using ODBC through CRecordset-derived classes). When I change my ODBC data source to point to Oracle, I have all sorts of problems with the SQL query strings being built wrong by MFC. It seems to mostly be that with SQL Server, it wants to use square brackets around columnn and table names, but Oracle needs quotes there. Example:
MFC generates queries like:
SELECT [account] FROM [Table1] WHERE [Balance] < 0
Oracle needs to have that query be:
SELECT "account" FROM "Table1" WHERE "Balance" < 0
Is there something I need to do to tell MFC what type of query string to produce? I've looked on MS's site and KnowledgeBase but can't seem to find this.
MFC generates queries like:
SELECT [account] FROM [Table1] WHERE [Balance] < 0
Oracle needs to have that query be:
SELECT "account" FROM "Table1" WHERE "Balance" < 0
Is there something I need to do to tell MFC what type of query string to produce? I've looked on MS's site and KnowledgeBase but can't seem to find this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That seemed to get me past the original problem. Thanks!
For others that run into this same scenario: I also had to go in and set the m_bUseUpdateSQL on the CRecordset to TRUE to get the whole thing completely working.
For others that run into this same scenario: I also had to go in and set the m_bUseUpdateSQL on the CRecordset to TRUE to get the whole thing completely working.