【正文】
同時,我們逐漸掌握了對VB與SQL軟件的應用,讓我們進一步的提升了自己的知識。但通過查閱資料等方法,我們最終克服了這些困難。錯誤!姓名中不可出現(xiàn)數(shù)字39。例如,圖()中生日年份越界會出現(xiàn)警告: 2)系統(tǒng)設置了部分主要信息的錯誤提示(輸入不能為空、姓名中不能出現(xiàn)數(shù)字、工號中只能出現(xiàn)數(shù)字、生日必須合法輸入、出勤次數(shù)必須大于缺勤、請假次數(shù)總和):例一:flag1 = False flag2 = False For i = 1 To Len(Trim()) If Mid(Trim(), i, 1) = 0 And Mid(Trim(), i, 1) = 9 Then flag1 = True End If Next For i = 1 To Len(Trim()) If Mid(Trim(), i, 1) 0 Or Mid(Trim(), i, 1) 9 Then flag2 = True End IfNextIf Trim() = Then MsgBox 姓名不能為空,請重新輸入!, vbOKOnly + vbExclamation, 警告 = Exit Sub End If If flag1 = True Then MsgBox 姓名不能含有數(shù)字!, vbOKOnly + vbExclamation, 警告 = Exit Sub End If If flag2 = True Then MsgBox 工號只能含有數(shù)字!, vbOKOnly + vbExclamation, 警告 = Exit Sub End If If Not IsDate(Trim()) Then MsgBox 生日必須為合法日期,請重新輸入!, vbOKOnly + vbExclamation, 警告 = Exit Sub End If例二:If CInt(Trim()) CInt(Trim()) + CInt(Trim()) Then MsgBox 出勤次數(shù)過少!, vbOKOnly + vbExclamation, 警告 = Exit Sub End If例三:strSql = Select , from employee a,department b where = strSql, dbConn, adOpenForwardOnly, adLockReadOnly If Then MsgBox 沒有員工資料,請先輸入資料!, vbOKOnly + vbExclamation, 警告 = False Exit Sub End If3)使用觸發(fā)器,在底層保證數(shù)據(jù)安全性功能:使姓名中不能出現(xiàn)數(shù)字。表頭項居中 = flexFillRepeat = 0 = 0 = 1 = 1 = 4 39。 設置列數(shù) = 10 39。填寫數(shù)據(jù) Do While Not = + 1 ( 1, 0) = (0).Value For i = 2 To ( 1, i) = (i 1).Value Next i Loop End If Label8 = 找到 amp。 strName amp。 strCheck amp。 cboCheckMonth amp。 ) Else 39。 amp。 cboCheckYear amp。 10 amp。 39。,39。 amp。 cboCheckYear amp。 03 amp。 39。,39。 amp。 cboCheckYear amp。 03 amp。 39。,39。 amp。 cboCheckMonth amp。 39。任意年份的指定月 strCheck = and in (39。 39。 End If 39。按姓名查詢 If Len(Trim(Text1)) = 0 Then strName = Else strName = and =39。 amp。設置各列的對齊方式 For i = 0 To 7 (i) = 0 Next i 39。職稱 strSql = Select title_id,title_name from title Order By title_id strSql, dbConn, adOpenForwardOnly, adLockReadOnly Do While Not ((title_name).Value) () = (title_id).Value Loop = 0 39。性別 男 女 = 0 39。 order by strSql, dbConn, adOpenForwardOnly, adLockReadOnly If Then Label9 = 找到0條記錄 = 1 Else 39。 amp。 amp。 amp。打開一個數(shù)據(jù)集 strSql = select , from employee a,education b,department c,duty d,title e where = and = and = and = amp。 amp。 amp。 amp。 amp。 amp。 amp。 amp。其功能結構如圖()::系統(tǒng)功能結構圖員工信息管理系統(tǒng)主要包含用戶登錄、新增、編輯、查詢功能模塊。 在“系統(tǒng)DSN”選項卡下,單擊“添加”按鈕,彈出如圖()所示對話框,在該對話框中選擇SQL Server選項。server=puter。uid=ZFS。,16,1) ROLLBACK RETURN END 建立索引create cluster index pk_duty on duty_idcreate cluster index pk_department on dept_idcreate cluster index pk_title on title_idcreate cluster index pk_education on edu_idcreate cluster index pk_sysuser on user_idcreate cluster index pk_employee on emp_idcreate cluster index pk_checkin on (emp_id,check_ym) VB數(shù)據(jù)庫連接語句Option ExplicitPublic dbConn As New Public logi