System Requirements Analysis
Postgraduate Personal information Management
Mentor Information Management
Professional information Management
Functional module Design
For the above requirements, the design of the functional modules as shown in Figure 10.34.
Data table Design
1. Postgraduate Information Data Sheet
Datasheet Name: Graduate_info. The datasheet structure is shown in table 10.4.
2. Professional Information Data Sheet
3. Instructor Information Data Sheet
Index and view Design
1. Index and view design of postgraduate information datasheet
2. Index and view design of professional information table
3. Index and view design of instructor information datasheet
Create a database user
(1) Make the following setting in the General Information tab of the creation user as shown in Figure 10.35.
(2) switch to the "Roles" tab of the creation user as shown in Figure 10.36.
(3) The SQL code for the successful creation of the above user is as follows.
―――――――――――――――――――――――――――――――――――――
CREATE USER "graduateuser" Profile "DEFAULT"
Identified by "12345678" DEFAULT tablespace "USERS"
Temporary tablespace "TEMP"
Account UNLOCK;
GRANT Unlimited tablespace to "Graduateuser";
GRANT "CONNECT" to "Graduateuser";
GRANT "RESOURCE" to "Graduateuser";
―――――――――――――――――――――――――――――――――――――
"See CD-ROM File": 10th Chapter \creategraduateuser.sql.
(4) The reader can execute Creategraduateuser.sql file creation user directly in "sqlplus Worksheet".
Creating data Tables
1. Create a Postgraduate information table
(1) Do the following in the General Information tab of the Create table as shown in Figure 10.37.
(2) Switch to the "Constraints" tab of the Create table as shown in Figure 10.38.
(3) The SQL code for the above creation data table Graduateuser.graduate_info is as follows.
(3) The SQL code for the above creation data table Graduateuser.graduate_info is as follows.
(4) The reader can create a datasheet graduateuser.graduate_info directly in the "Sqlplus Worksheet" Createtablegraduateinfo.sql file.
2. Create a professional information sheet
(1) The General Information tab of the Create table as shown in Figure 10.39 is set as shown in the illustration.
(2) Switch to the "Constraints" tab of the Create table as shown in Figure 10.40.
(3) The SQL code for the above creation data table Graduateuser.major_info is as follows.
"See CD-ROM File": 10th Chapter \createtablemajorinfo.sql.
(4) The reader can create a datasheet graduateuser.major_info directly in the "Sqlplus Worksheet" Createtablemajorinfo.sql file.
3. Create Mentor Information Table
(1) The General Information tab of the Create table as shown in Figure 10.41 is set as shown in the illustration.
(2) Switch to the "Constraints" tab of the Create table as shown in Figure 10.42.
(3) The SQL code for the above creation data table Graduateuser.director_info is as follows.
"See CD-ROM File": 10th Chapter \createtabledirectorinfo.sql.
(4) The reader can create a datasheet graduateuserdirector_info directly in the "Sqlplus Worksheet" Createtabledirectorinfo.sql file.
Create an index
1. Indexing the Name field of the Postgraduate information table
(1) Follow the illustration in the General Information tab of the Create index as shown in Figure 10.43.
(2) Other tabs follow the default settings.
(3) The SQL code to create the index above is as follows.
―――――――――――――――――――――――――――――――――――――
CREATE INDEX "Graduateuser". Postgraduate Surname name Segment Index "
On "Graduateuser". " Graduate_info "(" NAME ")
Tablespace "INDX"
―――――――――――――――――――――――――――――――――――――
"See CD-ROM File": 10th Chapter \createindexgraduate.sql.
(4) The reader can perform createindexgraduate.sql files directly in "Sqlplus Worksheet" to create a data table Graduateuser.graduate_info index "Postgraduate name Segment Index".
2. Index The Name field of the Mentor information table
(1) Follow the illustration in the General Information tab of the Create index as shown in Figure 10.44.
(2) Other tabs follow the default settings.
(3) The SQL code to create the index above is as follows.
―――――――――――――――――――――――――――――――――――――
CREATE INDEX "Graduateuser". Mentor Surname Name Segment Index "
On "Graduateuser". " Director_info "(" NAME ")
Tablespace "INDX"
―――――――――――――――――――――――――――――――――――――
"See CD-ROM File": 10th Chapter \createindexdirector.sql.
(4) The reader can perform createindexdirector.sql files directly in "Sqlplus Worksheet" to create a data table Graduateuser.director_info index "mentor surname name segment Index".
Create a View
1. Create a view for the Postgraduate information table
(1) Follow the illustration in the General Information tab of the Create view as shown in Figure 10.45.
(2) Other tabs follow the default settings.
(3) The SQL code to create the view above is as follows.
―――――――――――――――――――――――――――――――――――――
CREATE OR REPLACE VIEW "Graduateuser". View_graduate "as
SELECT *
From Graduateuser.graduate_info and READ only
―――――――――――――――――――――――――――――――――――――
"See CD-ROM File": 10th Chapter \createviewgraduate.sql.
(4) The reader can create a view "view_graduate" of a datasheet graduateuser.graduate_info directly in "Sqlplus Worksheet" by executing createviewgraduate.sql file.
2. Create a view for a professional information table
(1) Follow the illustration in the General Information tab of the Create view as shown in Figure 10.46.
(2) Other tabs follow the default settings.
(3) The SQL code to create the view above is as follows.
―――――――――――――――――――――――――――――――――――――
CREATE OR REPLACE VIEW "Graduateuser". View_major "as
SELECT *
From Graduateuser.major_info and READ only
―――――――――――――――――――――――――――――――――――――
"See CD-ROM File": 10th Chapter \createviewmajor.sql.
(4) The reader can create a view "View_major" of a datasheet graduateuser.major_info directly in "Sqlplus Worksheet" by executing createviewmajor.sql file.
2. Create a view for the Mentor information table
(1) Follow the illustration in the General Information tab of the Create view as shown in Figure 10.47.
(2) Other tabs follow the default settings.
(3) The SQL code to create the view above is as follows.
―――――――――――――――――――――――――――――――――――――
CREATE OR REPLACE VIEW "Graduateuser". View_director "as
SELECT *
From Graduateuser.director_info and READ only
―――――――――――――――――――――――――――――――――――――
"See CD-ROM File": 10th Chapter \createviewdirector.sql.
(4) The reader can execute Createviewdirector.sql file in "Sqlplus Worksheet" to create the View "View_director" of datasheet graduateuser.director_info
General framework of VB Project
The overall framework of the completed postgraduate management Information system is shown in table 10.7.
"See CD-ROM File": 10th chapter, Graduate Management Information System, VBP.
How the system works
(1) Start VB, open the supporting CD-ROM project documents.
(2) as shown in Figure 10.48.
(3) A "General" tab appears for the engineering properties shown in Figure 10.49.
(4) Open the module Module1, and see the code for the procedure named main as follows. Description The main procedure launches the primary form named Frmmain.
(5) Edit the main form named Frmmain, as shown in Figure 10.50.
(6) appear as shown in Figure 10.51, "menu Editor" interface, you can view the main form of the menu design.
The menu designed in the project is shown in table 10.8.
(7) Why do these menus call these subforms or do you want to exit the main form? In the main form of Figure 10.50, double-click the mouse, the main code in the Code window that appears is as follows.
―――――――――――――――――――――――――――――――――――――
' Select menu item directorinsertmenu will display the subform forminsertdirector
Private Sub Directorinsertmenu_click ()
Forminsertdirector.show
End Sub
' Select menu item directorselectmenu will display the subform formselectdirector
Private Sub Directorselectmenu_click ()
Formselectdirector.show
End Sub
' Select menu item directorupdatemenu will display the subform formupdatedirector
Private Sub Directorupdatemenu_click ()
Formupdatedirector.show
End Sub
' Select menu item graduateinsertmenu will display the subform forminsertgraduate
Private Sub Graduateinsertmenu_click ()
Forminsertgraduate.show
End Sub
' Select menu item graduateselectmenu will display the subform formselectgraduate
Private Sub Graduateselectmenu_click ()
Formselectgraduate.show
End Sub
' Select menu item graduateupdatemenu will display the subform formupdategraduate
Private Sub Graduateupdatemenu_click ()
Formupdategraduate.show
End Sub
' Select menu item majorinsertmenu will display the subform forminsertmajor
Private Sub Majorinsertmenu_click ()
Forminsertmajor.show
End Sub
' Select menu item majorupdatemenu will display the subform formupdatemajor
Private Sub Majorupdatemenu_click ()
Formupdatemajor.show
End Sub
' Select menu item Exitmenu will show exit main form
Private Sub Exitmenu_click ()
End
End Sub
―――――――――――――――――――――――――――――――――――――
The design of the module
The other major code for module Module1 is as follows.
―――――――――――――――――――――――――――――――――――――
' defines a parameterless function named ConnectString, which connects the database
Public Function connectstring () as String
ConnectString = "DSN=GRADUATEDB; Uid=graduateuser; pwd=12345678 "
End Function
' defines a parameter function named ExecuteSQL, and the parameter SQL and msgstring are all string types. This function is used to execute SQL statements.
Public Function ExecuteSQL (ByVal SQL As String, msgstring as String) as ADODB. Recordset
' Conn is a ADODB connection connection object
Dim Conn as ADODB. Connection
' Rest is a ADODB Recordset object
Dim rest as ADODB. Recordset
' If you execute a SQL error, turn to the executesql_error tag
On Error GoTo Executesql_error
Set conn = New ADODB. Connection
' Connect to the database
Conn. Open connectstring
Set rest = New ADODB. Recordset
' Execute SQL string statement
Rest. Open trim$ (SQL), Conn, adOpenKeyset, adLockOptimistic
Set ExecuteSQL = Rest
msgstring = "Query to" & rest. RecordCount & "Record"
' Shut down the connection and recordset after SQL has finished executing
Executesql_exit:
Set rest = Nothing
Set conn = Nothing
Exit Function
' How do I handle SQL errors
Executesql_error:
msgstring = "Query Error:" & _
Err.Description
Resume Executesql_exit
End Function
' defines a parameter function named Checktxt, and the parameter txt is a string type. This function is used to detect whether the TXT string has content.
Public Function checktxt (txt as String) as Boolean
If Trim (TXT) = "" Then
Checktxt = False
Else
Checktxt = True
End If
End Function
―――――――――――――――――――――――――――――――――――――
Design of each Subform
1. Add the Information Form design
Open the subform named Forminsertgraduate, as shown in Figure 10.52.
The form is designed as shown in table 10.8.
Table 10.8 Design of Forminsertgraduate for Subform
The form's program code is analyzed as follows.
2. Modify the design of the information form
Open the subform named Formupdategraduate, as shown in Figure 10.53.
The form is designed as shown in table 10.10.
The form's program code is analyzed as follows.
3 Query Information Form Design
Open the subform named Formselectgraduate, as shown in Figure 10.54. The form is designed as shown in table 10.11.
The code for the form is designed as follows.