PROBLEM:
I need to perform
INNER JOIN
between 2 SQL queries, but that query would have to access 2 MySQL databases located on their own servers.
Small example might explain better the problem I face:
select *
from Table1,
INNER JOIN Table2
on Table1.Id = Table2.Id;
RELEVANT INFORMATION:
- MFC and ODBC are used for database access
- I haven't used ODBC, nor MFC for database programming before
- application is a legacy one, so I can not use C++ 11 or newer
- Visual Studio 2008 is used
If further information is required please leave a comment.
QUESTION:
If using
m_strFilter[
^] with the second
CRecordset
is possible, can you instruct me how to do it (again, I have no prior experience with MFC and ODBC)?
I will accept C++ solution as well, but remember that I may not use C++ 11 or newer, since the application is a legacy one.
What I have tried:
This SO post[
^] suggest usage of
FEDERATED ENGINE
.
I am reluctant to use this approach since it has poor performance, according to various comments in the post.
Other option would be to perform both queries separately, and filter recordsets in code.
I have successfully executed separate queries, but
m_strFilter
accepts fixed string only, not
CRecordset
.
While writing this question, I am trying to figure out how to bypass the above limitation.