VC数据库开发
- 格式:ppt
- 大小:658.50 KB
- 文档页数:45
VC++使用ADO开发ACCESS数据库本文通过实例演示如何在VC++中使用ADO进行ACCESS数据库编程,并对涉及到的几个概念进行详细解释。
本文不对ADO和ACCESS的基本概念进行详细解释,主要包括以下内容:第一部分 ADO和ADOX到底是什么,二者的作用和区别建立数据库第二部分 ADOX创建ACCESS数据库第三部分ADO创建ACCESS数据库的表第四部分使用_ConnectionPtr接口开发ACCESS数据库第五部分使用_RecordsetPtr接口开发ACCESS数据库第一部分ADO和ADOX到底是什么,二者的作用和区别ADO是Microsoft 最新推出的数据库访问的高层软件接口。
它和Microsoft 以前的数据库访问接口DAO、RDO相比具有更大的灵活性,使用也更方便,开发效率大为提高。
ADOX是核心ADO对象的扩展库。
它提供的附加对象可用于创建、修改和删除模式对象,如表和过程。
要使用ADOX,则应建立对ADOX类型库的引用。
ADOX 库文件名为 Msadox.dll。
通俗地讲,ADO是访问数据库的一种接口,可以使用它方便地进行数据库编程。
而ADOX是微软对ADO功能的扩展,比如:可以ADOX创建数据库(而ADO 没有创建数据库的功能)。
第二部分ADOX创建ACCESS数据库用ADOX创建access数据库方法很简单,只需要创建一个Catalog对象,然后调用它的Create方法就可以了。
例程ADOXCreateDatabase演示如何使用ADOX创建一个ACCESS数据库。
打开VC++ 6.0,新建一个基于对话框的工程ADOXCreateDatabase。
在对话框IDD_ADOXCREATEDATABASE_DIALOG中添加一个编辑框IDC_DBNAME和一个按钮IDC_BTN_CREATE,编辑框用以输入数据库名称。
使用ClassWizard给编辑框创建一个CString变量m_dbName。
收稿日期226作者简介张秋波(3—),男,年毕业于西南交通大学地理信息系统专业,助理工程师。
文章编号:167227479(2010)0120016204浅谈利用VC ++对数据库的开发张秋波(中铁工程设计咨询集团有限公司济南设计院,山东济南 250022)D iscu ssi on on D evelopm en t of Da ta B a s e with VC ++Zhang Q iubo 摘 要 简要介绍了在VC ++610中使用ADO 进行客户端数据库编程的基本步骤,给出了一种在V isual C ++下封装ADO 访问数据库类的方法。
以S QL 中自带数据库North w ind 中的Catrgories 表为例,介绍其基本操作的实现过程。
关键词 VC ++ A DO 数据库中图分类号:P209 文献标识码:B1 开发环境的建立使用AppW izard 来创建MF C 工程(选择工程→新建→工程菜单,这时弹出创建向导对话框(如图1)),工程命名为“张秋波”。
图1 工程菜单在Step1中选择D 基本对话框然后单击完成。
(1)在主对话框中设置其I D :I DD_MY_D I A LOG,在工具的控制面板上选择List Contr ol 主对话框中拖出一个方框,点击右键选择Pr opertie s,设置其I D:I D C _L I ST,并利用C lassW izard (类向导)设置membe r va ri 2able na m e (变量名)为“m _list ”并添加相应的函数OnDblclkL ist 、OnR click L ist 。
然后利用工具的控制面板中的B utt on 创建四个按钮,标题分别为:添加、修改、删除、查询,I D 分别为:I DC_BUTTON_ADD 、I DC_BUT 2T ON _ED I T 、I DC _BUTT ON _D E L 、I D C _BUTTO N _SEARCH,并添加相应函数:OnB uttonAdd 、OnB utt on 2Del 、OnB uttonEdit 、OnButt onSearch 。
利用VC++和数据库开发办公文件管理系统摘要随着信息技术在管理上越来越深入而广泛的应用,信息管理系统的实施在技术上已逐步成熟。
信息管理系统是一个不断发展的新型学科,企业要生存要发展,要高效率地把企业活动有机地组织起来,就必须加强企业管理,即加强对企业内部的各种资源(人、财、物等)的有效管理,建立与自身特点相适应的管理信息系统。
这篇论文论述了小型办公文件管理系统的设计与开发。
以Visual C++ 为前台开发工具;以SQL Server2005开发后台数据库;利用WINDOWS XP作为运行平台开发的图书管理系统。
用软件工程的思想来指导,按照软件生命周期的不同阶段完成了本系统的开发。
实现的主要功能有:系统自身的更新和退出,文件的添加、删除、查询、打开、文件属性的显示、目录添加及类型查询。
系统已具有一定的实用功能。
本人结合办公实际要求的要求,对MS SQL Server2005数据库管理系统、SQL 语言原理、VC++6.0,ADO数据库访问技术进行了较深入的学习和应用。
主要完成对办公文件管理系统的系统设计、数据库设计、工程框架设计和工程模块设计,并由此设计了数据库结构和应用程序。
系统运行结果证明,本文所设计的办公文件管理系统能够满足办公人员对文件管理的需要。
第一章是课题背景、开发目的、意义、环境、运行环境及开发工具的介绍。
第二章是对数据库应用系统开发和办公文件管理系统进行了简明的介绍,并分析了开发办公文件管理系统所应进行的工作及可行性分析。
第三章对数据库的设计和SQL语言的使用进行了系统分析,为深入理解数据库应用打下了基础。
并对具体的开发工具VC++ 6.0和MFC进行了一般性的介绍。
第四章为办公文件管理系统的设计分析、数据库设计、工程框架设计和工程模块设计。
关键词办公文件管理系统;软件工程;设计与开发;VC++;SQL Server 2005Using VC + + And Database Development OfficeDocument Management SystemAlong with the information technology in the management of a more profound and extensive application of information management system in the implementation, technology has gradually matured. Information management system is a continuous development of new disciplines, to develop business to survive, efficiently to business activities organically, it must strengthen enterprise management, namely strengthens to enterprise interior each kind of resources (person, money, etc.) the effective management, establish its own characteristics and to adapt the management of information system.This paper describes a small office document management system design and development. Using Visual C + + to design; SQL Server2005 development background database; using WINDOWS XP as a platform to develop the library management system. Use the software engineering the thought to guide, according to the software life cycle different stage to complete the system development. Realization main function includes: the system update and exit, the document to add, delete, query, display, open, file attribute directory and add the type of query. The system has a certain practical function.I combine office actual request, the MS SQL Server2005 database management system, the principle of SQL language, VC++6.0, ADO database access technology for a morein-depth study and application. The completion of the main office document management system design, database design, engineering framework design and engineering design, the design and structure of the database and application program. Results prove that the system is running, the paper designed office file management system can satisfy the office staff to document management needs.The first chapter is the research background, purpose, significance, development environment, running environment and development tools introduced.The second chapter is on the database application system development and office document management system has been briefly introduced, and analysis of the development of office document management system, which should work.The third chapter of the database design and the use of SQL language to carry on the system analysis, the database for in-depth understanding of the foundation of the application. And the specific development tools VC + +6 and MFC gives a general introduction.The fourth chapter is the office document management system design and analysis, database design, module design frame of project design and engineering.Key words: office document management system; software engineering; design and development; VC + +; SQL Server 2005第一章绪论1.1 课题背景随着计算机技术的飞速发展,计算机在企业管理中应用的普及利用计算机实现文档管理势在自必行。