【正文】
ar namespace.. Conditional Compilation Statements Conditional pilation statements can appear almost anywhere in your source file. They cause parts of your code to be included or excluded at pile time depending on certain conditions. You can also use them for debugging your application, because conditional code runs in debugging mode only.. NamespaceLevel Programming Elements Classes, structures, and modules contain all the code in your source file. They are namespacelevel elements, which can appear within a namespace or at the source file level. They hold the declarations of all other programming elements. Interfaces, which define element signatures but provide no implementation, also appear at module level. Class Statement (Visual Basic) Structure Statement Module Statement Interface Statement (Visual Basic) Data elements at namespace level are enumerations and delegates. ModuleLevel Programming Elements Procedures, operators, properties, and events are the only programming elements that can hold executable code (statements that perform actions at run time). They are the modulelevel elements of your program. 陜西理工學(xué)院畢業(yè)設(shè)計 Function Statement (Visual Basic) Sub Statement (Visual Basic) Declare Statement Operator Statement Property Statement Event Statement Data elements at module level are variables, constants, enumerations, and delegates. ProcedureLevel Programming Elements Most of the contents of procedurelevel elements are executable statements, which constitute the runtime code of your program. All executable code must be in some procedure (Function, Sub, Operator, Get, Set, AddHandler, RemoveHandler, RaiseEvent). For more information, see Executable Statements. Data elements at procedure level are limited to local variables and constants. The Main Procedure The Main procedure is the first code to run when your application has been loaded. Main serves as the starting point and overall control for your application. There are four varieties of Main: Sub Main() Sub Main(ByVal cmdArgs() As String) Function Main() As Integer Function Main(ByVal cmdArgs() As String) As Integer About designing a database Good database design ensures that your database is easy to maintain. You store data in tables and each table contains data about only one subject, such as customers. Therefore, you update a particular piece of data, such as an address, in just one place and that change automatically appears throughout the database. A welldesigned database usually contains different types of queries that show the information you need. A query might show a subset of data, such as all customers in London, or binations of data from different tables, such as order information bined with customer information. The results you want from your database— the forms and data access pages (data access page: A Web page, published from Access, that has a connection to a database. In a data access page, you can view, add to, edit, and manipulate the data stored in the database. A page can also include data from other sources, such as Excel.) you want to use, and the reports you want to print— don39。使我本身的能力得到了不少的 提高 , 這對于我以后的工作和學(xué)習(xí)都有一種巨大的幫助。這些都有待進(jìn)一步改善 .也希望老師們能夠多多指教 ,好讓我能夠不斷進(jìn)步。對于數(shù)據(jù)的一致性的問題也通過程序進(jìn)行了有效的解決。其功能基本符合用戶需求,能夠完成題庫存儲、試卷的生成及用戶的管理。 性能測試:用戶管理、題庫管理、試卷生成及試卷的打印等系統(tǒng)功能均能實現(xiàn) 系統(tǒng)達(dá)到了預(yù)期的目標(biāo),但由于時間問題還有些不如人意,比如系統(tǒng)在藝術(shù)美觀上還有不足之處。 功能錯誤測試:經(jīng)測試發(fā)現(xiàn)系統(tǒng)的功 能正確,沒有遺漏,實現(xiàn)了對題庫管理、管理員可以對用戶進(jìn)行管理、試卷的生成和打印等功能。軟件測試的根本任務(wù)就是發(fā)現(xiàn)軟件中存在的錯誤在此我選擇黑盒法進(jìn)行測試。 陜西理工學(xué)院畢業(yè)設(shè)計 7 測試 在 Window XP Visual Basic Access 環(huán)境下進(jìn)行系統(tǒng)測試。 ADO控件還提供了用來瀏覽不同記錄的各種跳轉(zhuǎn)按鈕。缺省情況下, ADO 控件根據(jù)數(shù)據(jù)庫中的一個或多個數(shù)據(jù)表建立一個 dynasettype(動態(tài)集合)類型的記錄集合。 ADO( ActiveX Data Objects)是基于組件的數(shù)據(jù)庫編程接口,它是一個和編程語言無關(guān)的 COM 組件系統(tǒng) , ADO 控件在數(shù)據(jù)庫中的信息與將信息顯示給用戶看的 Visual Basic 程序之間架起了一座橋梁。 微軟的 JET數(shù)據(jù)庫引擎提供了與數(shù)據(jù)庫打交道的途徑,我們是通過它以及 Visual Basic 來訪問數(shù)據(jù)庫并對其進(jìn)行各種操作。生成獨立應(yīng)用或脫離服務(wù)器運行的服 務(wù)以上的應(yīng)用, Visual Basic 連接數(shù)據(jù)庫的方式有兩種: 第一 通過使用 Visual Basic 的 ADO 控件。 篩選出全部記錄 用戶管理界面的實現(xiàn)如圖 圖 用戶管理界面圖 手動試卷界面的實現(xiàn)如圖 圖 通過 SQL語句 select* from tkgl where 是否出卷 =’ 是 ’ 選出出試卷的記錄 陜西理工學(xué)院畢業(yè)設(shè)計 自動試卷的實現(xiàn)如圖 圖 與 VB的連接 Visual Basic 提供了與底層數(shù)據(jù)庫系統(tǒng)緊密的連接。 陜西理工學(xué)院畢業(yè)設(shè)計 出卷界面 自動出卷界面的實現(xiàn)如圖 圖 自動出卷界面圖 題目查詢界面的實現(xiàn)如圖 圖 題目查詢界面圖 陜西理工學(xué)院畢業(yè)設(shè)計 通過 ADO控件連接到數(shù)據(jù)庫的各個表,通過 SQL語句 ss = = select * from tkgl where =39。屬性設(shè)為可寫。, my, adOpenKeyset, adLockOptimistic If = True And = True Then MsgBox 查無此人 , , 登陸信息 Else If myrs(pass) = pass Then MsgBox ok, , 登陸信息 user = myrs(user) Unload Me Else MsgBox 密碼不正確 , , 登陸信息 End If End If End Sub 主界面的實現(xiàn)如圖 圖 主界面圖 首先在用戶管理判斷出是否管理員 If user = 管理員 Then 用戶管理 .Show Else MsgBox 身份錯誤 如果不是則無法進(jìn)行用戶管理 陜西理工學(xué)院畢業(yè)設(shè)計 題庫登記界面的實現(xiàn)如圖 圖 題庫登記界面圖 通過 ADO控件連接到數(shù)據(jù)庫的 tkgl基礎(chǔ)數(shù)據(jù)表,通過 SQL語句“ SELECT * from。 SELECT * FROM [user] where ()=39。 圖 系統(tǒng)流程圖 登陸界面的實現(xiàn)如圖 圖 登陸界面圖 在命令按鈕單擊寫下連接數(shù)據(jù)庫 USER表的判斷語句 Private Sub Command1_Click() mname = pass = 陜西理工學(xué)院畢業(yè)設(shè)計 Dim my As New Dim myrs As New Set myrs = New Provider=。 , my, adOpenKeyset, adLockOptimistic (3) 查詢問題 單級查詢使用 SELECT * FORM TKGL WHERE 字段 =SS 多級查詢使用 SELECT * FORM TKGL WHERE 字段 1 =SS AND字段 2 =SS2 按任務(wù)書的要求及具體設(shè)計情況將系統(tǒng)劃分為登陸、題庫登記、類型設(shè)