createdb

所属分类:数据库编程
开发工具:Visual Basic
文件大小:8KB
下载次数:56
上传日期:2008-10-20 21:28:33
上 传 者tocat
说明:  一个创建数据库的例程,使用DAO编程,对初学者有帮助啊,Add a New Table to an Access Database
(A routine to create the database, using DAO programming, help for beginners ah, Add a New Table to an Access Database)

文件列表:
frmCreateDatabase.frm (29312, 2001-09-20)
modGlobal.bas (3994, 2001-09-20)
prjCreateDb.vbp (875, 2001-09-20)

Sept. 19, 2001 Language: Visual Basic 6.0 - Professional/Enterprise Editions *************************************************************************** First of all, this was something I did to see if I could do it. I saw so many programs that showed how to create a DAO database, create and append a table with one field, and wanted one that would allow the user to create a database with as many fields as they required. If someone can see a better way of doing it, by all means "go for it". In any case, I had fun and learned alot. I was inspired by a snippet available on "FreeVBCode" (http://www.freevbcode.com) called "Add a New Table to an Access Database". Thankx Guys! The code has been desk checked several times and "should" be free of bugs. However, as we all know those are "famous last words". I have written the program to create a DAO database and append a "Primary Key" to the top of the table. This of course can be coded to create a primary key of any field in the table. OK, now into the program: It is contained in one form. I saw no need at this time to create a separate module. Possibly, at a later time, I may want to do this. It's pretty straight forward, and I tried to document it as much as possible. I didn't get fancy, I tried to follow the "KISS" (Keep It Simple Stupid) principle as much as I could. 1.) Enter the database name in the top textbox 2.) Enter the table name in the second box 3.) Enter the number of rows your database will require 4.) When the row count textbox is "tabbed" out of, the code will create new text fields(rows) and expand the form to allow the fields to be accessed. 5.) When the last row is complete, hit the tab key and focus will be put on the "Create Database" button. Click this button and the program will create the database, create the table, append the fields to the table, and append the table to the database. 6.) The rest is up to you, the programmer. 7.) If you have any enhancements to this, please let me know: G. Walsh mailto:thor67@ix.netcom.com

近期下载者

相关文件


收藏者