Problem sorting predefined query using ODBC 
Author Message
 Problem sorting predefined query using ODBC

I am using VisualC++ 5.0.  I was to call a parameterised predefined query
in an Access D/B.  I have got this working OK using the following syntax :-

 mySQL = "{CALL myquery(?,?)}"

 pSet->Open(CRecordset::snapshot,mySQL,CRecordset::readOnly);

My problem is this.  I was to determine the sorting criteria at runtime
so I can't add this to the query design.  However, if I try to use the
m_strSort member of CRecordset it just seems to ignore it.

I tried it in VisualC++ 6.0 and it got worse.  I got an error message saying
it couldn't find the query because it was appending the ORDER BY
'column_name'
clause to the query name before trying to open it.

Does anyone have any ideas on this ?

Thanks in anticipation.

Alan



Sun, 08 Dec 2002 03:00:00 GMT  
 Problem sorting predefined query using ODBC
I am using VisualC++ 5.0.  I was to call a parameterised predefined query
in an Access D/B.  I have got this working OK using the following syntax :-

 mySQL = "{CALL myquery(?,?)}"

 pSet->Open(CRecordset::snapshot,mySQL,CRecordset::readOnly);

My problem is this.  I was to determine the sorting criteria at runtime
so I can't add this to the query design.  However, if I try to use the
m_strSort member of CRecordset it just seems to ignore it.

I tried it in VisualC++ 6.0 and it got worse.  I got an error message saying
it couldn't find the query because it was appending the ORDER BY
'column_name'
clause to the query name before trying to open it.

Does anyone have any ideas on this ?

Thanks in anticipation.

Alan



Sun, 08 Dec 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. DoFieldExchange and Predefined Queries (ODBC)

2. Predefined Queries (ODBC)

3. Problem with SQL query using Access + ODBC

4. Predefined Queries and DAO

5. CRecordset-Predefined query calling VB code

6. CRecordset: predefined queries with parameters that have an apostrophe

7. CRecordset - parameterized predefined queries/stored procedures

8. Query db using MFC via ODBC

9. Accessing an Ms Access 2000 Query using VC++, via ODBC

10. Querying a database by using MFC ODBC and MSQL 6.5

11. Partially field query using ODBC

12. problem querying excel file tables via odbc

 

 
Powered by phpBB® Forum Software