ODBC programming - need help
-
I just started programming VC++6 with database support and I already have a major problem: I created a SDI application and when I choose only one table from the Access database everything goes well. But I can't handle 2 or more table from the same database.... How do I use 2 or more table and how do I execute queries(SQL) on tables??? :confused: I really need help as soon as possible... A small application using a database with 2 or more table and which shows how to execute SQL queries on different tables would be great... I would really appreciate that! Please help me... :-O Croitoriu Andrei croi2001@yahoo.com
-
I just started programming VC++6 with database support and I already have a major problem: I created a SDI application and when I choose only one table from the Access database everything goes well. But I can't handle 2 or more table from the same database.... How do I use 2 or more table and how do I execute queries(SQL) on tables??? :confused: I really need help as soon as possible... A small application using a database with 2 or more table and which shows how to execute SQL queries on different tables would be great... I would really appreciate that! Please help me... :-O Croitoriu Andrei croi2001@yahoo.com
I would recommand you to use a real database server, Firebird for example. www.ibphoenix.com Do you want to program odbc lowlevel? If not, take a look at the database-Classes here in codeproject. http://www.codeproject.com/database/#ODBC[^] There are some examples. Hardy.
-
I just started programming VC++6 with database support and I already have a major problem: I created a SDI application and when I choose only one table from the Access database everything goes well. But I can't handle 2 or more table from the same database.... How do I use 2 or more table and how do I execute queries(SQL) on tables??? :confused: I really need help as soon as possible... A small application using a database with 2 or more table and which shows how to execute SQL queries on different tables would be great... I would really appreciate that! Please help me... :-O Croitoriu Andrei croi2001@yahoo.com
The SQL query generated by ClassWizard should have formed the JOIN clause automatically. In case it didn't, you'll need to do it manually. For example, here is a JOIN on three tables of a database I recently worked on:
SELECT [Meet].[Name], [Meet].[Date], [Gymnast].[Name], [Scores].[Score1]
FROM Meet INNER JOIN (Gymnast INNER JOIN Scores ON [Gymnast].[AutoNumber]=[Scores].[GymnastNum]) ON [Meet].[AutoNumber]=[Scores].[MeetNum]
ORDER BY meet.date;Search MSDN for different examples of LEFT, RIGHT, INNER, FULL, CROSS, and OUTER joins.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen