Huwebes, Marso 15, 2012

3 sample programs in Microsoft Visual C++ 6.0 intefacing with MS Access DataBase

1.
GUI:


DataBase:
studentnumber         name                           location                        degree
1                        Handayan, Pedro              Caridad, Pilar                   BSIT
2                        Reyes, John Christian        General Luna                    BSIT
3                        Congreso, Karla Jane             Dapa                          BSIT
4                        Oriendo, Marina                General Luna                   BSIT
5                        Piodos, Rosalyn Piodos      Sta. Monica                    BSIT

code behind:

on MS Access 2007 application;
attributes:name(character-25),location(character-25),degree(character-10)

on MFC AppWizard(.exe);
void.........
//todo: ..........
{
m_text1=m_pSet->m_studentnumber;
UpdateData(false);
m_text2=m_pSet->m_name;
UpdateData(false);
m_text3=m_pSet->m_location;
UpdateData(false);
m_text4=m_pSet->m_degree;
UpdateData(false);
}


2.
GUI:
      


DataBase:

order number                    order                                               price
 01                             chicken w/ rice and coke                       79.00
 02                             chicken and burger w/ coke                   89.00
 03                             2pcs. chicken w/ rice and coke              90.00
 04                             lasagna w/ coke                                     79.00
 05                             spaghetti w/ chum and coke                    89.00


code behind;

on MS Access 2007 application:
attributes:order number(int),order(character-100),price(int)

on MFC AppWizard(.exe):
void.........
//todo:...........
{
m_text1=m_pSet->m_ordernumber;
UpdateData(false);
m_tex2=m_pSet->m_price;
UpdateData(false);
}

3.
GUI:




DataBase:
id number                                name                                      program
001                                  Piodos, Rosalyn A.                         BSIT
002                                  Murilla, Denmar A.                         BSCS
003                                  Petilo, Jade C.                                BSOA
004                                  Reyes, John Christian                      BSCRIM

code behind;

on MS Access 2007 application:

attributes:id number (int),name(char),program(char);

on MFC AppWizard(.exe):
void...........
//todo:..............
{
m_text1=m_pSet->m_id;
UpdateData(false);
m_text2=m_pSet->m_name;
UpdateData(false);
m_text3=m_pSet->m_program;
UpdateData( false);
}

Walang komento:

Mag-post ng isang Komento