5. ADO--- Several steps to operate databases with ActiveX Data Object
The first step is to set the database data source. To access the database, you need to create a database name in "ODBC Data Sources" in "Control Panel", click the "Add" button, select the drivers and files used by the database, etc.
The second step is to use "Server.CreateObject" to establish the connected object and use "Open" to open the database to be accessed. set adocon=Server.CreateObject("ADODB.Connection"); adocon.Open "zxtest"
The third step is to set the SQL command and use the "Execute" command to start the action of accessing the database.
sqlstr ="select * from jsjwl where stbh like 'PD' order by stbh ASC"
set rs = adocon.Execute(sqlstr) ′adocon is the object name set in the second step
The fourth step uses the command of the Recordset object to display the results, where rs is defined in the third step.
rs.fields.count: The number of fields recorded;
rs(i).name: The field name of the i (pointer), i is calculated from 0 to rs.fields.count-1;
rs(i): reads the record of the i (pointer) field, and i is calculated from 0 to rs.fields.count-1;
rs("field name"): reads the record of the specified field; rs.eof: Whether the last item has been specified;
rs.movenext: Move the pointer to the next one; rs.moveprev: Move the pointer to the previous one;
rs.movefirst: Move the pointer to the first line; rs.movelast: Move the pointer to the last line;
Step 5: Close the database after use:
rs.close; adocon.close
6. Data security and confidentiality
Due to the particularity of this system, the security and confidentiality of data are particularly important. Confidentiality means that all information on the Internet should be kept confidential, and the content between different types of users is kept confidential. Security means that users participate in an event is a safe process, and the server tracks all user actions. In order to ensure its safety and confidentiality, one must ensure that candidates cannot cheat online; two must monitor the test papers in real time; three must strictly control the time, etc. It is mainly achieved through the following two ways:
First, all users who enter the online exam must pass user identity verification (see the picture below) before entering. Moreover, different users have different operation permissions, and support operation according to permissions to ensure the public and privateness of the data. Users are not allowed to perform illegal operations to prevent unintentional or intentional damage from users.
Second, users are prohibited from viewing the source files and copying functions of all test papers. There are two methods:
1. It is prohibited to use the right mouse button and other functions;
II. The test papers in the test paper library will be presented to the viewer in a page without pull-down menus and toolbars.