Click here to Skip to main content
15,920,687 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Anone used CxImage?? Pin
Shehzad Salim19-Nov-03 21:05
Shehzad Salim19-Nov-03 21:05 
GeneralRe: Anone used CxImage?? Pin
Prakash Nadar19-Nov-03 21:26
Prakash Nadar19-Nov-03 21:26 
GeneralQuery data in unknown binary file Pin
NotProfessional19-Nov-03 17:57
NotProfessional19-Nov-03 17:57 
GeneralRe: Query data in unknown binary file Pin
Johnny ²19-Nov-03 21:39
Johnny ²19-Nov-03 21:39 
GeneralRe: Query data in unknown binary file Pin
NotProfessional20-Nov-03 3:51
NotProfessional20-Nov-03 3:51 
GeneralRe: Query data in unknown binary file Pin
Johnny ²20-Nov-03 5:24
Johnny ²20-Nov-03 5:24 
GeneralSimple problem Pin
helpapp19-Nov-03 17:53
helpapp19-Nov-03 17:53 
GeneralRe: Simple problem Pin
Antti Keskinen19-Nov-03 20:42
Antti Keskinen19-Nov-03 20:42 
A brief introduction of database programming with ODBC:

The database programming model in MFC, for example, consists of clearly seperated elements. Firstly, you have a database object. This object represents the connection to a database. The database itself can be of any type (MySQL, Oracle, MS SQL), as databse objects are bound to the databases through either the database driver or a data source definition.

Data source definitions are entries in ODBC Manager. They specify the database driver used, login name, password, target database and any necessary flags or settings. You can use the driver directly through a database object as well.

Next step up, we have a recordset object. A recordset object represents a query to a database: a collection of one or more SQL statements and a set of internal variables to hold the response from these statements. When you construct a recordset object, you can specify a database object reference for it. This means that any statements you execute and the results of those statements are handled in the context of this very database.

For the recordset objects, they contain a FieldExchange object, which is responsible for doing the field exchange between the results received from the recordset and the internal variables you have specified. Overriding the member function 'DoFieldExchange' allows you to specify how the returning results are stored.

More information is available in the MSDN Reference for classes CDatabase and CRecordset. Also, there is a good quantity of different articles available here at CodeProject. This[^] is a good place to start: look articles which have a 'Beginner' level specification next to them. These articles will help you get started. The rest is experiencing and testing.

The most easiest way in Visual Studio .NET 2003 is to add a MFC ODBC Database consumer class to your project. The wizard will help you through then.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: Simple problem Pin
helpapp19-Nov-03 22:41
helpapp19-Nov-03 22:41 
GeneralA Question On GDI+ Pin
Prakash Nadar19-Nov-03 17:15
Prakash Nadar19-Nov-03 17:15 
GeneralRe: A Question On GDI+ Pin
Mike Dimmick20-Nov-03 0:02
Mike Dimmick20-Nov-03 0:02 
GeneralReading in a file Pin
gymrat6119-Nov-03 17:01
sussgymrat6119-Nov-03 17:01 
GeneralRe: Reading in a file Pin
parths19-Nov-03 19:39
parths19-Nov-03 19:39 
GeneralRe: Reading in a file Pin
l a u r e n20-Nov-03 13:17
l a u r e n20-Nov-03 13:17 
GeneralWhen I meet the character "%"... Pin
Jim Chan19-Nov-03 15:09
Jim Chan19-Nov-03 15:09 
GeneralRe: When I meet the character "%"... Pin
Brian Shifrin19-Nov-03 15:25
Brian Shifrin19-Nov-03 15:25 
GeneralIE Toolbar Pin
okinawascubadiver19-Nov-03 13:50
okinawascubadiver19-Nov-03 13:50 
GeneralRe: IE Toolbar Pin
Peter Molnar20-Nov-03 10:25
Peter Molnar20-Nov-03 10:25 
GeneralRe: IE Toolbar Pin
Roger Stewart21-Nov-03 8:37
professionalRoger Stewart21-Nov-03 8:37 
QuestionWhich is the simplest way to close an application? Pin
julych19-Nov-03 11:54
julych19-Nov-03 11:54 
AnswerRe: Which is the simplest way to close an application? Pin
Peter Molnar19-Nov-03 12:37
Peter Molnar19-Nov-03 12:37 
GeneralRe: Which is the simplest way to close an application? Pin
julych19-Nov-03 19:33
julych19-Nov-03 19:33 
GeneralRe: Which is the simplest way to close an application? Pin
l a u r e n20-Nov-03 13:19
l a u r e n20-Nov-03 13:19 
AnswerRe: Which is the simplest way to close an application? Pin
alex.barylski19-Nov-03 12:48
alex.barylski19-Nov-03 12:48 
GeneralRe: Which is the simplest way to close an application? Pin
julych19-Nov-03 19:36
julych19-Nov-03 19:36 

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.