Click here to Skip to main content
15,915,160 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalcalculating response time for a http request Pin
emmatty11-Sep-04 0:36
emmatty11-Sep-04 0:36 
GeneralRe: calculating response time for a http request Pin
Alexander M.,12-Sep-04 4:28
Alexander M.,12-Sep-04 4:28 
Generallist control selection Pin
Tyrus18210-Sep-04 18:51
Tyrus18210-Sep-04 18:51 
GeneralRe: list control selection Pin
Branislav11-Sep-04 4:05
Branislav11-Sep-04 4:05 
GeneralRe: list control selection Pin
Tyrus18211-Sep-04 4:20
Tyrus18211-Sep-04 4:20 
GeneralRe: list control selection Pin
Branislav11-Sep-04 5:04
Branislav11-Sep-04 5:04 
GeneralRe: list control selection Pin
Ravi Bhavnani11-Sep-04 5:07
professionalRavi Bhavnani11-Sep-04 5:07 
GeneralADO MySQL query problem Pin
Graham Holdaway10-Sep-04 16:34
Graham Holdaway10-Sep-04 16:34 
Hi guys,

Just encountered a small problem with ADO when trying to read data from two tables in a database that have the same variable names. In my example I have table_1 with a variable called "id" and a table_2 which also has a variable called "id". The id's in each table are not related. I then want to execute a mysql query something like this:

select table_1.id, table_1.country, table_2.id, table_2.country \
from table_1,table_2 where table_1.country=table_2.country

In this case I am matching table_1 to table_2 by country. So far so good. The problem comes when I want read back the values using this method:

var_1 = (long *) (_bstr_t)pRecordSet->GetCollect("id");

In this line above, how does ADO know which id value I am referring too?? I tried this:

var_1 = (long *) (_bstr_t)pRecordSet->GetCollect("tablel_1.id");
var_2 = (long *) (_bstr_t)pRecordSet->GetCollect("tablel_2.id");

.. but it didn't like "tablel_1.id" How can I distinguish between the two if tables contain the same variable names? In this case "country" is the same in both tables, so that one doesn't matter, but id dcoes. I can't find any example anywhere in books or the web. All the examples seem to have tables with completely different variables names and hence do not have this problem.

Help anyone?, I would be very grateful.

Graham.
GeneralRe: ADO MySQL query problem Pin
Arsalan Malik10-Sep-04 20:23
Arsalan Malik10-Sep-04 20:23 
GeneralRe: ADO MySQL query problem Pin
Anonymous11-Sep-04 18:51
Anonymous11-Sep-04 18:51 
GeneralChange mainframe menu on startup Pin
Ravi Bhavnani10-Sep-04 13:38
professionalRavi Bhavnani10-Sep-04 13:38 
GeneralRe: Change mainframe menu on startup Pin
Neville Franks11-Sep-04 12:35
Neville Franks11-Sep-04 12:35 
GeneralRe: Change mainframe menu on startup Pin
Ravi Bhavnani11-Sep-04 12:57
professionalRavi Bhavnani11-Sep-04 12:57 
GeneralCalling VC COM DLL from C++ Pin
Peter Weyzen10-Sep-04 11:36
Peter Weyzen10-Sep-04 11:36 
GeneralHighlight Selected Item in ListCtrl Pin
Grahamfff10-Sep-04 10:59
Grahamfff10-Sep-04 10:59 
GeneralRe: Highlight Selected Item in ListCtrl Pin
Ravi Bhavnani10-Sep-04 13:40
professionalRavi Bhavnani10-Sep-04 13:40 
GeneralRe: Highlight Selected Item in ListCtrl Pin
Grahamfff11-Sep-04 8:33
Grahamfff11-Sep-04 8:33 
GeneralRe: Highlight Selected Item in ListCtrl Pin
Grahamfff11-Sep-04 8:43
Grahamfff11-Sep-04 8:43 
GeneralRe: Highlight Selected Item in ListCtrl Pin
Tyrus18211-Sep-04 8:50
Tyrus18211-Sep-04 8:50 
GeneralRe: Highlight Selected Item in ListCtrl Pin
Grahamfff11-Sep-04 9:18
Grahamfff11-Sep-04 9:18 
GeneralRe: Highlight Selected Item in ListCtrl Pin
Tyrus18211-Sep-04 12:47
Tyrus18211-Sep-04 12:47 
GeneralRe: Highlight Selected Item in ListCtrl Pin
Grahamfff12-Sep-04 9:50
Grahamfff12-Sep-04 9:50 
GeneralHighlight Selected Item in ListCtrl Pin
Grahamfff10-Sep-04 10:59
Grahamfff10-Sep-04 10:59 
GeneralRe: Highlight Selected Item in ListCtrl Pin
Ravi Bhavnani10-Sep-04 13:40
professionalRavi Bhavnani10-Sep-04 13:40 
QuestionVC++ 6.0 compiler error with adding function with struct variable??? Pin
Vaclav10-Sep-04 9:55
Vaclav10-Sep-04 9:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.