【文章內(nèi)容簡(jiǎn)介】
ity Info=False。userid=sa。Initial Catalog=master (sp_attach_db @dbname=39。 amp。 strdata amp。 39。,@filename1=39。 amp。 m amp。 39。)MsgBox 附加成功!, , XSCJUnload MeExit Subdataerr:MsgBox , , XSCJEnd Sub圖63“登錄”按鈕的click事件添加如下的代碼:Private Sub Command1_Click()If = Or = Then MsgBox 請(qǐng)輸入完整的登錄信息! Exit SubEnd IfIf = Then MsgBox 請(qǐng)輸入驗(yàn)證碼 Exit SubEnd IfDim i As Integeri = Len()If i 6 Then MsgBox 用戶名應(yīng)為六位數(shù)字, , 提示 = Exit SubEnd Ifi = Len()If i 6 Then MsgBox 密碼應(yīng)為六位, , 提示 = Exit SubEnd IfIf UCase(Trim()) Trim() Then MsgBox 驗(yàn)證碼輸入錯(cuò)誤 = Exit SubEnd IfDim sqlcon As New Dim sqlres As New Set sqlcon = New connectstringIf Then Set sqlres = New select * from dlgl where 用戶名=39。 + Trim() + 39。 and 密碼=39。 + Trim() + 39。, connectstring, adOpenDynamic, adLockPessimistic If Not Then juese = yonghuming = Trim() mima = Trim() MsgBox 登錄成功 Unload Me Exit Sub Else MsgBox 用戶名或密碼錯(cuò)誤! = = = Randomize i = Int(Rnd * 25 + 65) j = Int(Rnd * 25 + 65) k = Int(Rnd * 25 + 65) l = Int(Rnd * 25 + 65) = Chr(i) amp。 Chr(j) amp。 Chr(k) amp。 Chr(l) Exit Sub End IfEnd IfIf Then Set sqlres = New select * from dl where 用戶名=39。 + Trim() + 39。 and 密碼=39。 + Trim() + 39。, connectstring, adOpenDynamic, adLockPessimistic If Not Then juese = yonghuming = Trim() mima = Trim() MsgBox 登錄成功 Unload Me Exit Sub Else MsgBox 用戶名或密碼錯(cuò)誤! = = = Randomize i = Int(Rnd * 25 + 65) j = Int(Rnd * 25 + 65) k = Int(Rnd * 25 + 65) l = Int(Rnd * 25 + 65) = Chr(i) amp。 Chr(j) amp。 Chr(k) amp。 Chr(l) End IfEnd IfEnd Sub圖64“更新”按鈕的click事件添加如下的代碼:Private Sub Command1_Click()39。Set sqlres = New 39。 = select * from xs where 學(xué)號(hào)=39。 amp。 Trim() amp。 39。 39。 = adCmdText39。Dim s As StringDim bytedata() As ByteDim adofld As s = select * from xs where 學(xué)號(hào)=39。 amp。 Trim() amp。 39。 s, connectstring, adOpenDynamic, adLockPessimisticIf Not Then (1) = Trim() (2) = If = True Then (3) = 1 Else (3) = 0 End If If Trim() Then (5) = CInt() End If (7) = Trim()