友情提示:如果本网页打开太慢或显示不完整,请尝试鼠标右键“刷新”本网页!
富士康小说网 返回本书目录 加入书签 我的书架 我的书签 TXT全本下载 『收藏到我的浏览器』

SQL 21日自学通(V3.0)(PDF格式)-第63部分

快捷操作: 按键盘上方向键 ← 或 → 可快速上下翻页 按键盘上的 Enter 键可回到本书目录页 按键盘上方向键 ↑ 可回到本页顶部! 如果本书没有阅读完,想下次继续接着阅读,可使用上方 "收藏到我的浏览器" 功能 和 "加入书签" 功能!





#include 〃tyssql。h〃 



#include 〃tyssqset。h〃 



#include 〃tyssqdoc。h〃 



#include 〃tyssqvw。h〃 



#ifdef _DEBUG 



#undef THIS_FILE 



static char BASED_CODE THIS_FILE'' = __FILE__; 



#endif 



///////////////////////////////////////////////////////////////////////////// 



// CTyssqlView 



IMPLEMENT_DYNCREATE(CTyssqlView; CRecordView) 



BEGIN_MESSAGE_MAP(CTyssqlView; CRecordView) 



        //{{AFX_MSG_MAP(CTyssqlView) 



                //  NOTE   the  ClassWizard  will  add  and  remove  mapping  macros  here。 



                //        DO  NOT  EDIT  what  you  see  in  these  blocks  of  generated  code! 



        //}}AFX_MSG_MAP 



END_MESSAGE_MAP() 



///////////////////////////////////////////////////////////////////////////// 



// CTyssqlView construction/destruction 



                                                                                                                510 


…………………………………………………………Page 511……………………………………………………………

SQL 21  日自学通(V1。0)                                                                          翻译人      笨猪 



CTyssqlView::CTyssqlView() 



        :  CRecordView(CTyssqlView::IDD) 



{ 



        //{{AFX_DATA_INIT(CTyssqlView) 



        m_pSet  =  NULL; 



        //}}AFX_DATA_INIT 



    // TODO: add construction code here 



} 



CTyssqlView::~CTyssqlView() 



{ 



} 



void CTyssqlView::DoDataExchange(CDataExchange* pDX) 



{ 



        CRecordView::DoDataExchange(pDX); 



        //{{AFX_DATA_MAP(CTyssqlView) 



        DDX_FieldText(pDX;  IDC_ADDRESS;  m_pSet…》m_ADDRESS;  m_pSet); 



        DDX_FieldText(pDX;  IDC_NAME;  m_pSet…》m_NAME;  m_pSet); 



        DDX_FieldText(pDX;  IDC_STATE;  m_pSet…》m_STATE;  m_pSet); 



        DDX_FieldText(pDX;  IDC_ZIP;  m_pSet…》m_ZIP;  m_pSet); 



        //}}AFX_DATA_MAP 



} 



void CTyssqlView::OnInitialUpdate() 



{ 



        m_pSet  =  &GetDocument()…》m_tyssqlSet; 



        CRecordView::OnInitialUpdate(); 



} 



///////////////////////////////////////////////////////////////////////////// 



// CTyssqlView diagnostics 



#ifdef _DEBUG 



void CTyssqlView::AssertValid() const 



                                                                                                       511 


…………………………………………………………Page 512……………………………………………………………

SQL 21  日自学通(V1。0)                                                                                 翻译人       笨猪 



{ 



        CRecordView::AssertValid(); 



} 



void CTyssqlView::Dump(CDumpContext& dc) const 



{ 



        CRecordView::Dump(dc); 



} 



CTyssqlDoc* CTyssqlView::GetDocument() // non…debug version is inline 



{ 



        ASSERT(m_pDocument…》IsKindOf(RUNTIME_CLASS(CTyssqlDoc))); 



        return  (CTyssqlDoc*)m_pDocument; 



} 



#endif //_DEBUG 



///////////////////////////////////////////////////////////////////////////// 



// CTyssqlView database support 



CRecordset* CTyssqlView::OnGetRecordset() 



{ 



        return  m_pSet; 



} 



///////////////////////////////////////////////////////////////////////////// 



// CTyssqlView message handlers 



// tyssqset。cpp : implementation of the CTyssqlSet class 



// 



#include 〃stdafx。h〃 



#include 〃tyssql。h〃 



#include 〃tyssqset。h〃 



///////////////////////////////////////////////////////////////////////////// 



// CTyssqlSet implementation 



IMPLEMENT_DYNAMIC(CTyssqlSet; CRecordset) 



CTyssqlSet::CTyssqlSet(CDatabase* pdb) 



                                                                                                              512 


…………………………………………………………Page 513……………………………………………………………

SQL 21  日自学通(V1。0)                                                                             翻译人      笨猪 



        :  CRecordset(pdb) 



{ 



        //{{AFX_FIELD_INIT(CTyssqlSet) 



        m_NAME  =  〃〃; 



        m_ADDRESS  =  〃〃; 



        m_STATE  =  〃〃; 



        m_ZIP  =  〃〃; 



        m_PHONE  =  〃〃; 



        m_REMARKS  =  〃〃; 



        m_nFields  =  6; 



        //}}AFX_FIELD_INIT 



} 



CString CTyssqlSet::GetDefaultConnect() 



{ 



        return  〃ODBC;DSN=TYSSQL;〃; 



} 



CString CTyssqlSet::GetDefaultSQL() 



{ 



    return 〃SELECT * FROM CUSTOMER ORDER BY NAME〃; 



} 



void CTyssqlSet::DoFieldExchange(CFieldExchange* pFX) 



{ 



        //{{AFX_FIELD_MAP(CTyssqlSet) 



        pFX…》SetFieldType(CFieldExchange::outputColumn); 



        RFX_Text(pFX;  〃NAME〃;  m_NAME); 



        RFX_Text(pFX;  〃ADDRESS〃;  m_ADDRESS); 



        RFX_Text(pFX;  〃STATE〃;  m_STATE); 



        RFX_Text(pFX;  〃ZIP〃;  m_ZIP); 



        RFX_Text(pFX;  〃PHONE〃;  m_PHONE); 



        RFX_Text(pFX;  〃REMARKS〃;  m_REMARKS); 



                                                                                                         513 


…………………………………………………………Page 514……………………………………………………………

SQL 21  日自学通(V1。0)                                                                               翻译人       笨猪 



        //}}AFX_FIELD_MAP 



} 



// tyssql。cpp : Defines the class behaviors for the application。 



// 



#include 〃stdafx。h〃 



#include 〃tyssql。h〃 



#include 〃mainfrm。h〃 



#include 〃tyssqset。h〃 



#include 〃tyssqdoc。h〃 



#include 〃tyssqvw。h〃 



#ifdef _DEBUG 



#undef THIS_FILE 



static char BASED_CODE THIS_FILE'' = __FILE__; 



#endif 



///////////////////////////////////////////////////////////////////////////// 



// CTyssqlApp 



BEGIN_MESSAGE_MAP(CTyssqlApp; CWinApp) 



        //{{AFX_MSG_MAP(CTyssqlApp) 



        ON_MAND(ID_APP_ABOUT;  OnAppAbout) 



                //  NOTE   the  ClassWizard  will  add  and  remove  mapping  macros  here。 



                //        DO  NOT  EDIT  what  you  see  in  these  blocks  of  generated  code! 



        //}}AFX_MSG_MAP 



END_MESSAGE_MAP() 



///////////////////////////////////////////////////////////////////////////// 



// CTyssqlApp construction 



CTyssqlApp::CTyssqlApp() 



{ 



    // TODO: add construction code here; 



        //  Place  all  significant  initialization  in  InitInstance 



} 



                                                                                                            514 


…………………………………………………………Page 515……………………………………………………………

SQL 21  日自学通(V1。0)                                                                                          翻译人        笨猪 



///////////////////////////////////////////////////////////////////////////// 



// The one and only CTyssqlApp object 



CTyssqlApp NEAR theApp; 



///////////////////////////////////////////////////////////////////////////// 



// CTyssqlApp initialization 



BOOL CTyssqlApp::InitInstance() 



{ 



        //  Standard  initialization 



    // If you are not using these features and wish to reduce the size 



        //    of  your  final  executable;  you  should  remove  from  the  following 



        //    the  specific  initialization  routines  you  do  not  need。 



        SetDialogBkColor();                //  Set  dialog  background  color  to  gray 



        LoadStdProfileSettings();    //  Load  standard  INI  file  options  (including  MRU) 



        //  Register  the  application's  document  templates。    Document  templates 



    //  serve as the connection between documents; frame windows and views。 



        CSingleDocTemplate*  pDocTemplate; 



        pDocTemplate  =  new  CSingleDocTemplate( 



                IDR_MAINFRAME; 



                RUNTIME_CLASS(CTyssqlDoc); 



                RUNTIME_CLASS(CMainFrame);          //  main  SDI  frame  window 



                RUNTIME_CLASS(CTyssqlView)); 



        AddDocTemplate(pDocTemplate); 



    // create a new (empty) document 



        OnFileNew(); 



        if  (m_lpCmdLine'0'  !=  '0') 



        { 



                //  TODO:  add  mand  line  processing  here 



        } 



        return  TRUE; 



} 



                                                                                                                        515 


…………………………………………………………Page 516……………………………………………………………

SQL 21  日自学通(V1。0)                                                                             翻译人      笨猪 



///////////////////////////////////////////////////////////////////////////// 



// CAboutDlg dialog used for App About 



class CAboutDlg : public CDialog 



{ 



public: 



        CAboutDlg(); 



// Dialog Data 



        //{{AFX_DATA(CAboutDlg) 



    enum { IDD = IDD_ABOUTBOX }; 



        //}}AFX_DATA 



// Implementation 



protected: 



        virtual  void  DoDataExchange(CDataExchange*  pDX);        //  DDX/DDV  support 



        //{{AFX_MSG(CAboutDlg) 



                //  No  message  handlers 



        //}}AFX_MSG 



        DECLARE_MESSAGE_MAP() 



}; 



CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) 



{ 



        //{{AFX_DATA_INIT(CAboutDlg) 



        //}}AFX_DATA_INIT 



} 



void CAboutDlg::DoDataExchange(CDataExchange* pDX) 



{ 



        CDialog::DoDataExchange(pDX); 



        //{{AFX_DATA_MAP(CAboutDlg) 



        //}}AFX_DATA_MAP 



} 



BEGIN_MESSAGE_MAP(CAboutDlg; CDialog) 



                                                                                                         516 


…………………………………………………………Page 517……………………………………………………………

SQL 21  日自学通(V1。0)                                                                               翻译人       笨猪 



        //{{AFX_MSG_MAP(CAboutDlg) 



                //  No  message  handlers 



        //}}AFX_MSG_MAP 



END_MESSAGE_MAP() 



// App mand to run the dialog 



void CTyssqlApp::OnAppAbout() 



{ 



        CAboutDlg  aboutDlg; 



        aboutDlg。DoModal(); 



} 



///////////////////////////////////////////////////////////////////////////// 



// CTyssqlApp mands 



// tyssqdoc。cpp : implementation of the CTyssqlDoc class 



// 



#include 〃stdafx。h〃 



#include 〃tyssql。h〃 



#include 〃tyssqset。h〃 



#include 〃tyssqdoc。h〃 



#ifdef _DEBUG 



#undef THIS_FILE 



static char BASED_CODE THIS_FILE'' = __FILE__; 



#endif 



///////////////////////////////////////////////////////////////////////////// 



// CTyssqlDoc 



IMPLEMENT_DYNCREATE(CTyssqlDoc; CDocument) 



BEGIN_MESSAGE_MAP(CTyssqlDoc; CDocument) 



        //{{AFX_MSG_MAP(CTyssqlDoc) 



                //  NOTE   the  ClassWizard  will  add  and  remove  mapping  macros  here。 



                //        DO  NOT  EDIT  what  you  see  in  these  blocks  of  generated  code! 



        //}}AFX_MSG_MAP 



                                                                                                            517 


…………………………………………………………Page 518……………………………………………………………

SQL 21  日自学通(V1。0)                                                                             翻译人      笨猪 



END_MESSAGE_MAP() 



///////////////////////////////////////////////////////////////////////////// 



// CTyssqlDoc construction/destruction 



CTyssqlDoc::CTyssqlDoc() 



{ 



    // TODO: add one…time construction code here 



} 



CTyssqlDoc::~CTyssqlDoc() 



{ 



} 



BOOL CTyssqlDoc::OnNewDocument() 



{ 



        if  (!CDocument::OnNewDocument()) 



                return  FALSE; 



        //  TODO:  add  reinitialization  code  here 



    // (SDI documents will reuse this document) 



        return  TRUE; 



} 



///////////////////////////////////////////////////////////////////////////// 



// CTyssqlDoc diagnostics 



#ifdef _DEBUG 



void CTyssqlDoc::AssertValid() const 



{ 



        CDocument::AssertValid(); 



} 



void CTyssqlDoc::Dump(CDumpContext& dc) const 



{ 



        CDocument::Dump(dc); 



} 



#endif //_DEBUG 



                                                                                                         518 


…………………………………………………………Page 519……………………………………………………………

SQL 21  日自学通(V1。0)                                                                                 翻译人       笨猪 



///////////////////////////////////////////////////////////////////////////// 



// CTyssqlDoc mands 



// stdafx。cpp : source file that includes just the standard includes 



//  stdafx。pch will be the pre…piled header 



//  stdafx。obj will contain the pre…piled type information 



#include 〃stdafx。h〃 



// mainfrm。cpp : implementation of the CMainFrame class 



// 



#include 〃stdafx。h〃 



#include 〃tyssql。h〃 



#include 〃mainfrm。h〃 



#ifdef _DEBUG 



#undef THIS_FILE 



static char BASED_CODE THIS_FILE'' = __FILE__; 



#endif 



///////////////////////////////////////////////////////////////////////////// 



// CMainFrame 



IMPLEMENT_DYNCREATE(CMainFrame; CFrameWnd) 



BEGIN_MESSAGE_MAP(CMainFrame; CFrameWnd) 



        //{{AFX_MSG_MAP(CMainFrame) 



                //  NOTE   the  ClassWizard  will  add  and  remove  mapping  macros  here。 



                //        DO  NOT  EDIT  what  you  see  in  these  blocks  of  generated  code  ! 



        ON_WM_CREATE() 



        //}}AFX_MSG_MAP 



END_MESSAGE_MAP() 



///////////////////////////////////////////////////////////////////////////// 



// arrays of IDs used to initialize control bars 



// toolbar buttons IDs are mand buttons 



static UINT BASED_CODE buttons'' = 



{ 



                                                                                                              519 


…………………………………………………………Page 520……………………………………………………………

SQL 21  日自学通(V1。0)                                                                             翻译人      笨猪 



    // same order as in the bitmap 'toolbar。bmp' 



        ID_EDIT_CUT; 



        ID_EDIT_COPY; 



        ID_EDIT_PASTE; 



                ID_SEPARATOR; 



        ID_FILE_PRINT; 



                ID_SEPARATOR; 



        ID_RECORD_FIRST; 



        ID_RECORD_PREV; 



        ID_RECORD_NEXT; 



        ID_RECORD_LAST; 



                ID_SEPARATOR; 



        ID_APP_ABOUT; 



}; 



static UINT BASED_CODE in
返回目录 上一页 下一页 回到顶部 9 9
快捷操作: 按键盘上方向键 ← 或 → 可快速上下翻页 按键盘上的 Enter 键可回到本书目录页 按键盘上方向键 ↑ 可回到本页顶部!
温馨提示: 温看小说的同时发表评论,说出自己的看法和其它小伙伴们分享也不错哦!发表书评还可以获得积分和经验奖励,认真写原创书评 被采纳为精评可以获得大量金币、积分和经验奖励哦!