資源簡介
在MFC框架中,使用ADO連接Access數據庫,開發的小型圖書管理系統。包括數據庫連接、查詢、修改、增刪等,還有界面重繪。

代碼片段和文件信息
//?BorrowDlg.cpp?:?implementation?file
//
#include?“stdafx.h“
#include?“main.h“
#include?“BorrowDlg.h“
#include?“mainDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CBorrowDlg?dialog
CBorrowDlg::CBorrowDlg(CWnd*?pParent?/*=NULL*/)
:?CDialog(CBorrowDlg::IDD?pParent)
{
//{{AFX_DATA_INIT(CBorrowDlg)
m_read?=?_T(““);
m_book?=?_T(““);
m_overday?=?0;
m_money?=?_T(“0“);
//}}AFX_DATA_INIT
}
void?CBorrowDlg::DoDataExchange(CDataExchange*?pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CBorrowDlg)
DDX_Control(pDX?IDC_EDIT2?m_eread);
DDX_Control(pDX?IDC_EDIT1?m_edbook);
DDX_Text(pDX?IDC_EDIT1?m_read);
DDX_Text(pDX?IDC_EDIT2?m_book);
DDX_Text(pDX?IDC_EDIT4?m_overday);
DDX_Text(pDX?IDC_EDIT3?m_money);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CBorrowDlg?CDialog)
//{{AFX_MSG_MAP(CBorrowDlg)
ON_EN_CHANGE(IDC_EDIT1?onchangeEdit1)
ON_EN_CHANGE(IDC_EDIT2?onchangeEdit2)
ON_BN_CLICKED(IDC_PAYOFF?OnPayoff)
ON_WM_ERASEBKGND()
ON_WM_CTLCOLOR()
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CBorrowDlg?message?handlers
BOOL?CBorrowDlg::OnInitDialog()?
{
CDialog::OnInitDialog();
m_data_read=(CDataGrid?*)GetDlgItem(IDC_DATA_READ);
????m_data_book=(CDataGrid?*)GetDlgItem(IDC_DATA_BOOK);
GetDlgItem(IDC_PAYOFF)->ShowWindow(false);
return?TRUE;??//?return?TRUE?unless?you?set?the?focus?to?a?control
??????????????//?EXCEPTION:?OCX?Property?Pages?should?return?FALSE
}
//DEL?BOOL?CBorrowDlg::PreCreateWindow(CREATESTRUCT&?cs)?
//DEL?{
//DEL? //?TODO:?Add?your?specialized?code?here?and/or?call?the?base?class
//DEL?
//DEL? return?CDialog::PreCreateWindow(cs);
//DEL?}
void?CBorrowDlg::PreSubclassWindow()?
{
//?TODO:?Add?your?specialized?code?here?and/or?call?the?base?class
//CRect?rect;
//this->GetWindowRect(rect);
//this->SetWindowPos(NULLrect.leftrect.topbt.bmWidthbt.bmHeightSWP_frameCHANGED);
CDialog::PreSubclassWindow();
}
void?CBorrowDlg::OnCancel()?
{
//?TODO:?Add?extra?cleanup?here
//CDialog::OnCancel();
this->ShowWindow(SW_HIDE);
}
void?CBorrowDlg::OnOK()?
{
//?TODO:?Add?extra?validation?here
UpdateData();
CMainDlg?*main=(CMainDlg?*)this->GetParent();
if(m_read.IsEmpty())
{
???//MessageBox(“借書證號不能為空“);
???GetDlgItem(IDC_EDIT1)->SetFocus();
???return?;
}
if(m_book.IsEmpty())
{
???//MessageBox(“圖書ID不能為空“);
GetDlgItem(IDC_EDIT2)->SetFocus();
???return?;
}
long?read_ID=atoi(m_read);
long?book_ID=atoi(m_book);
????CString?cs;
//查詢讀者、圖書是否存在或輸入是否正確
cs.Format(“select?*?from?讀者信息表圖書基本信息?where?讀者信息表.借書證號=%ld?and?\
圖書基本信息.圖書ID=%ld“read_IDbook_ID);
if(!main->OnSQLexcute(main->m_precordset_variant_t(cs)))
return?;
if(main->m_precordset->GetRecordCount()
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-05-28?21:23??圖書館管理系統(修正版)1.0\
?????文件????????9411??2012-06-26?16:42??圖書館管理系統(修正版)1.0\BorrowDlg.cpp
?????文件????????1744??2012-06-26?12:32??圖書館管理系統(修正版)1.0\BorrowDlg.h
?????文件????????6290??2012-07-02?23:25??圖書館管理系統(修正版)1.0\DataDlg.cpp
?????文件????????1543??2012-06-30?21:40??圖書館管理系統(修正版)1.0\DataDlg.h
?????目錄???????????0??2015-05-28?21:22??圖書館管理系統(修正版)1.0\Debug\
?????文件??????778240??2015-05-28?21:22??圖書館管理系統(修正版)1.0\Debug\圖書管理數據庫.mdb
?????文件????????4113??2012-06-19?21:21??圖書館管理系統(修正版)1.0\LogoButton.cpp
?????文件????????1500??2012-06-19?21:19??圖書館管理系統(修正版)1.0\LogoButton.h
?????文件????????9962??2012-07-03?10:00??圖書館管理系統(修正版)1.0\LogoDlg.cpp
?????文件????????2141??2012-06-27?16:19??圖書館管理系統(修正版)1.0\LogoDlg.h
?????文件????????5841??2012-06-27?11:49??圖書館管理系統(修正版)1.0\MyButton.cpp
?????文件????????1503??2012-06-19?21:21??圖書館管理系統(修正版)1.0\MyButton.h
?????文件????????1163??2012-06-09?11:35??圖書館管理系統(修正版)1.0\MyEdit.cpp
?????文件????????1156??2012-06-09?11:34??圖書館管理系統(修正版)1.0\MyEdit.h
?????文件?????????550??2012-06-09?09:11??圖書館管理系統(修正版)1.0\NewButton.cpp
?????文件?????????562??2012-06-09?09:11??圖書館管理系統(修正版)1.0\NewButton.h
?????文件????????3543??2012-06-03?21:48??圖書館管理系統(修正版)1.0\ReadMe.txt
?????文件????????5949??2012-06-27?11:16??圖書館管理系統(修正版)1.0\RegisterDlg.cpp
?????文件????????1647??2012-06-19?18:00??圖書館管理系統(修正版)1.0\RegisterDlg.h
?????文件????????6374??2012-06-26?16:35??圖書館管理系統(修正版)1.0\ReturnDlg.cpp
?????文件????????1478??2012-06-25?21:29??圖書館管理系統(修正版)1.0\ReturnDlg.h
?????文件????????5649??2012-06-27?17:02??圖書館管理系統(修正版)1.0\SetDlg.cpp
?????文件????????1415??2012-06-27?16:59??圖書館管理系統(修正版)1.0\SetDlg.h
?????文件?????????206??2012-06-03?21:48??圖書館管理系統(修正版)1.0\StdAfx.cpp
?????文件????????1229??2012-06-19?21:12??圖書館管理系統(修正版)1.0\StdAfx.h
?????文件????????5993??2012-06-07?20:13??圖書館管理系統(修正版)1.0\column.cpp
?????文件????????2135??2012-06-07?20:13??圖書館管理系統(修正版)1.0\column.h
?????文件????????1337??2012-06-07?20:13??圖書館管理系統(修正版)1.0\columns.cpp
?????文件????????1293??2012-06-07?20:13??圖書館管理系統(修正版)1.0\columns.h
?????文件???????18667??2012-06-07?20:13??圖書館管理系統(修正版)1.0\datagrid.cpp
............此處省略69個文件信息
- 上一篇:c++鄰接矩陣源碼
- 下一篇:MFC 在dialog上畫坐標
評論
共有 條評論