database with mfc - Programmer

This is a discussion on database with mfc - Programmer ; hi everybody, i want some prog. that connect database using MFC in vc++ mostly with ADO. thanking you...

+ Reply to Thread
Results 1 to 3 of 3

Thread: database with mfc

  1. database with mfc

    hi everybody,

    i want some prog. that connect database using MFC in vc++ mostly with ADO.

    thanking you

  2. Re: database with mfc

    first off: you should use ODBC, its by far the easiest way of using a
    database.
    Second: when you have registered your database within the system you can
    contruct a CDatabase object.
    use ->open to connect to the database, for more information about the
    arguments you look here:
    http://msdn.microsoft.com/library/de...us/vcmfc98/htm
    l/_mfc_cdatabase.3a3a.cdatabase.asp
    now you can contruct a CRecordset object like this for example:
    CDatabase *db;
    CRecordset *rec1;
    db = new CDatabase;
    db->open(... , ..., ..., ...);
    rec1 = new CRecordset(db);
    rec1->open(NULL, put your SQL-string here);

    now rec1 should have the requested recordset from the specified database,
    note that this is just a rough setup and doesnt include options and futher
    initialisations. You should refer to the MSDN-library about other options
    (you might want to open as Dynaset instead of snapshot).
    Anyway this should get you on your way,

    Paul Schouten

    "lalit" wrote in message
    news:aa6afbd8.0308210009.4af29d9e@posting.google.c om...
    > David Phillip Oster wrote in message

    news:...
    > > In article ,
    > > coollg01@yahoo.com (lalit) wrote:
    > >
    > > > i want some prog. that connect database using MFC in vc++ mostly with

    ADO.
    > >
    > > Look at the built-in MFC database classes. Check the on-line help (MSDN
    > > Library). I've used CDatabase and CRecordset to connect to SQL databases
    > > that I've registered on the ODBC control panel.

    >
    > thanx for your time for above i have seen that but it could not help me

    much
    >
    > if any body could give me some usefull link on database ...
    >
    > thanx




  3. Re: database with mfc

    Thanx for your help, its very usefull.


    *********************************
    "paul schouten" wrote in message news:<3f950a1d$0$58703$e4fe514c@news.xs4all.nl>...
    > first off: you should use ODBC, its by far the easiest way of using a
    > database.
    > Second: when you have registered your database within the system you can
    > contruct a CDatabase object.
    > use ->open to connect to the database, for more information about the
    > arguments you look here:
    > http://msdn.microsoft.com/library/de...us/vcmfc98/htm
    > l/_mfc_cdatabase.3a3a.cdatabase.asp
    > now you can contruct a CRecordset object like this for example:
    > CDatabase *db;
    > CRecordset *rec1;
    > db = new CDatabase;
    > db->open(... , ..., ..., ...);
    > rec1 = new CRecordset(db);
    > rec1->open(NULL, put your SQL-string here);
    >
    > now rec1 should have the requested recordset from the specified database,
    > note that this is just a rough setup and doesnt include options and futher
    > initialisations. You should refer to the MSDN-library about other options
    > (you might want to open as Dynaset instead of snapshot).
    > Anyway this should get you on your way,
    >
    > Paul Schouten
    >
    > "lalit" wrote in message
    > news:aa6afbd8.0308210009.4af29d9e@posting.google.c om...
    > > David Phillip Oster wrote in message

    > news:...
    > > > In article ,
    > > > coollg01@yahoo.com (lalit) wrote:
    > > >
    > > > > i want some prog. that connect database using MFC in vc++ mostly with

    > ADO.
    > > >
    > > > Look at the built-in MFC database classes. Check the on-line help (MSDN
    > > > Library). I've used CDatabase and CRecordset to connect to SQL databases
    > > > that I've registered on the ODBC control panel.

    > >
    > > thanx for your time for above i have seen that but it could not help me

    > much
    > >
    > > if any body could give me some usefull link on database ...
    > >
    > > thanx


+ Reply to Thread