This article welcomes the non-commercial use of reprint, but need to indicate from the "Programming Network" and the corresponding URL link.
I'm using Access 2003 because it's just adding, modifying, and deleting data, so a single database, a single table, is enough. If you later want to write more complex information management systems involving multiple table operations, you will also need to supplement your knowledge of relational databases, such as entities, one-to-one relationships, one-to-many relationships, and so on, as well as understanding the SQL language. Specifically you can refer to: ABC of database Basics.
First, on the e disk of my computer, create a new name as a VB folder, open Access first, create a new database named access_db (the Access database file extension is. mdb), save to the folder you just created, then call the data source in the program at a later location of the E:\ Vb\access_db.mdb.
Then create a table named Wzdz in Access_db.mdb (Wzdz is the initials of the site address), and then add the site name, site address, and site description in the Wzdz table three fields, and the properties of the three fields are the same, as follows:
▲ Data type: text.
▲ Field Size: 50
▲ Validity rule: none.
▲ Required Fields: No
▲ Allow empty string: No
▲ Index: None
Number This field uses the AutoNumber of access and takes it as the primary key. That is, you can set the above three fields in a table, and when you have finished saving the table, you can add the primary key as prompted by access, and access will automatically fix it for you. Specific actions you can refer to: VB Prodigy Tutorial (continued)--VB Connect an Access database instance
In this way, after the database and table structure is established, the system can run without errors even when the empty library is called without records, and you can add records to the database at run time through the Add Record button. However, because the database is empty, the first time the system Runtime data display control no data can be displayed, it appears empty, not very beautiful oh. For convenience, we add an initial record to the Wzdz table in Access:
Number |
Site name |
Website address |
Website description |
1 |
Getting Started with programming web |
http://www.bianceng.cn |
A variety of programming documents, computer tutorials and software application tips, your computer technology gas station! |
The method you add is simple: Double-click the Wzdz table name in the designer of access, and add it in the window. Note When adding: because we are using the automatic number of access key, so in addition to the "number" of the field, add directly after the three fields can be.
The next step is to design the interface of the system and set the properties of each object.
See a full set of "VB Prodigy Tutorials" (continued)