• 大小: 10.94MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-24
  • 语言: C/C++
  • 标签: VC  数据库  Access  

资源简介

VC++6.0开发的数据库管理系统,数据库文件为SCHOOL.mdb,无需安装Access软件,ODBC连接方式

资源截图

代码片段和文件信息

// ChangeDegradeDlg.cpp : implementation file
//

#include “stdafx.h“
#include “school.h“
#include “ChangeDegradeDlg.h“
#include “ChangeDegradeInfoDlg.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CChangeDegradeDlg dialog


CChangeDegradeDlg::CChangeDegradeDlg(CWnd* pParent /*=NULL*/)
: CDialog(CChangeDegradeDlg::IDD pParent)
{
//{{AFX_DATA_INIT(CChangeDegradeDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}


void CChangeDegradeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CChangeDegradeDlg)
DDX_Control(pDX IDC_LIST1 m_ctrList);
//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CChangeDegradeDlg CDialog)
//{{AFX_MSG_MAP(CChangeDegradeDlg)
ON_BN_CLICKED(IDC_BUTTON_NEW OnButtonNew)
ON_BN_CLICKED(IDC_BUTTON_MODIFY OnButtonModify)
ON_BN_CLICKED(IDC_BUTTON_DELETE OnButtonDelete)
ON_NOTIFY(NM_DBLCLK IDC_LIST1 OnDblclkList1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CChangeDegradeDlg message handlers

BOOL CChangeDegradeDlg::OnInitDialog() 
{
CDialog::OnInitDialog();

m_ctrList.InsertColumn(0“编号“);
m_ctrList.InsertColumn(1“留级人“);
m_ctrList.InsertColumn(2“原属班级“);
m_ctrList.InsertColumn(3“留级班级“);
m_ctrList.InsertColumn(4“留级日期“);
m_ctrList.InsertColumn(5“留级原因“);

m_ctrList.SetColumnWidth(080);
m_ctrList.SetColumnWidth(180);
m_ctrList.SetColumnWidth(280);
m_ctrList.SetColumnWidth(380);
m_ctrList.SetColumnWidth(480);
m_ctrList.SetColumnWidth(5120);
m_ctrList.SetExtendedstyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
RefreshData();

return TRUE;  // return TRUE unless you set the focus to a control
              // EXCEPTION: OCX Property Pages should return FALSE
}


void CChangeDegradeDlg::RefreshData()
{

m_ctrList.DeleteAllItems();
m_ctrList.SetRedraw(FALSE);

UpdateData(TRUE);
CString strSQL;
strSQL=“select * from degrade“;
if(!m_recordset.Open(AFX_DB_USE_DEFAULT_TYPEstrSQL))
{
MessageBox(“打开数据库失败!““数据库错误“MB_OK);
return ;
}
int i=0;
while(!m_recordset.IsEOF())
{

m_ctrList.InsertItem(im_recordset.m_code);
m_ctrList.SetItemText(i1m_recordset.m_name);
m_ctrList.SetItemText(i2m_recordset.m_class_past);
m_ctrList.SetItemText(i3m_recordset.m_class_now);
m_ctrList.SetItemText(i4m_recordset.m_date);
m_ctrList.SetItemText(i5m_recordset.m_reason);

i++;
m_recordset.MoveNext();
}
m_recordset.Close();
m_ctrList.SetRedraw(TRUE);

}

void CChangeDegradeDlg::OnButtonNew() 
{
// TODO: Add your control notification handler code here
CString strSQL;
CChangeDegradeInfoDlg   Dlg;
while(1)
{
if(IDOK==Dlg.DoModal())
{
strSQL.Format(“select * from degrade where code = ‘%s‘“

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-05-10 12:10  SCHOOL\
     目录           0  2018-05-10 12:07  SCHOOL\backup\
     文件        6692  2018-05-10 12:07  SCHOOL\ChangeDegradeDlg.cpp
     文件        1526  2018-05-10 12:07  SCHOOL\ChangeDegradeDlg.h
     文件        2469  2018-05-10 12:07  SCHOOL\ChangeDegradeInfoDlg.cpp
     文件        1507  2018-05-10 12:07  SCHOOL\ChangeDegradeInfoDlg.h
     文件        1623  2018-05-10 12:07  SCHOOL\ChangeDegradeSet.cpp
     文件        1435  2018-05-10 12:07  SCHOOL\ChangeDegradeSet.h
     文件        6952  2018-05-10 12:07  SCHOOL\ChangeInsideDlg.cpp
     文件        1513  2018-05-10 12:07  SCHOOL\ChangeInsideDlg.h
     文件        5293  2018-05-10 12:07  SCHOOL\ChangeInsideInfoDlg.cpp
     文件        1715  2018-05-10 12:07  SCHOOL\ChangeInsideInfoDlg.h
     文件        1656  2018-05-10 12:07  SCHOOL\ChangeInsideSet.cpp
     文件        1439  2018-05-10 12:07  SCHOOL\ChangeInsideSet.h
     文件        6230  2018-05-10 12:07  SCHOOL\ChangeLeaveDlg.cpp
     文件        1500  2018-05-10 12:07  SCHOOL\ChangeLeaveDlg.h
     文件        2204  2018-05-10 12:07  SCHOOL\ChangeLeaveInfoDlg.cpp
     文件        1427  2018-05-10 12:07  SCHOOL\ChangeLeaveInfoDlg.h
     文件        1505  2018-05-10 12:07  SCHOOL\ChangeLeaveSet.cpp
     文件        1387  2018-05-10 12:07  SCHOOL\ChangeLeaveSet.h
     文件        6630  2018-05-10 12:07  SCHOOL\ChangeSuspandDlg.cpp
     文件        1526  2018-05-10 12:07  SCHOOL\ChangeSuspandDlg.h
     文件        2300  2018-05-10 12:07  SCHOOL\ChangeSuspandInfoDlg.cpp
     文件        1470  2018-05-10 12:07  SCHOOL\ChangeSuspandInfoDlg.h
     文件        1593  2018-05-10 12:07  SCHOOL\ChangeSuspandSet.cpp
     文件        1425  2018-05-10 12:07  SCHOOL\ChangeSuspandSet.h
     文件        6297  2018-05-10 12:07  SCHOOL\ChangeTranserDlg.cpp
     文件        1529  2018-05-10 12:07  SCHOOL\ChangeTranserDlg.h
     文件        2305  2018-05-10 12:07  SCHOOL\ChangeTransferInfoDlg.cpp
     文件        1460  2018-05-10 12:07  SCHOOL\ChangeTransferInfoDlg.h
     文件        1550  2018-05-10 12:07  SCHOOL\ChangeTransferSet.cpp
............此处省略168个文件信息

评论

共有 条评论