计算机应用 | 古代文学 | 市场营销 | 生命科学 | 交通物流 | 财务管理 | 历史学 | 毕业 | 哲学 | 政治 | 财税 | 经济 | 金融 | 审计 | 法学 | 护理学 | 国际经济与贸易
计算机软件 | 新闻传播 | 电子商务 | 土木工程 | 临床医学 | 旅游管理 | 建筑学 | 文学 | 化学 | 数学 | 物理 | 地理 | 理工 | 生命 | 文化 | 企业管理 | 电子信息工程
计算机网络 | 语言文学 | 信息安全 | 工程力学 | 工商管理 | 经济管理 | 计算机 | 机电 | 材料 | 医学 | 药学 | 会计 | 硕士 | 法律 | MBA
现当代文学 | 英美文学 | 通讯工程 | 网络工程 | 行政管理 | 公共管理 | 自动化 | 艺术 | 音乐 | 舞蹈 | 美术 | 本科 | 教育 | 英语 |

VB高速公路票据管理系统(一)毕业论文(4)

2013-05-08 18:11
导读:Exit Sub End If If Len(Trim(txtPassword.Text)) = 0 Then MsgBox "用户密码为空,请重新输入!!", vbOKOnly Exit Sub End If With conlogin If .State = adStateOpen Then .Close End If .Provider

Exit Sub
End If

If Len(Trim(txtPassword.Text)) = 0 Then
MsgBox "用户密码为空,请重新输入!!", vbOKOnly
Exit Sub
End If
 
With conlogin
If .State = adStateOpen Then
   .Close
End If
  .Provider = "microsoft.jet.oledb.4.0"
  .ConnectionString = App.Path & "\jinbin.mdb"
  .Open
End With

With rstlogin
If .State = adStateOpen Then
   .Close
End If
   .LockType = adLockReadOnly
   .CursorLocation = adUseClient
   .CursorType = adOpenDynamic
   .ActiveConnection = conlogin
   .Source = "select * from userinfo"
   .Open
 
If Trim(txtPassword.Text) = flagpassword And Len(Trim(txtPassword.Text)) = Len(flagpassword) Then
If flagadmin = "高级用户" Then
wt.flagnumber = 79802223
Unload Me
mainfrm.Show
ElseIf flagadmin = "一般用户" Then
wt.flagnumber = 32220897
Unload Me
mainfrm.Show
Else
MsgBox "非法人员及权限,请找管理员", vbOKOnly
Exit Sub
End If
Else
MsgBox "密码错误,请重新输入"
Exit Sub
End If
End With
End Sub

Private Sub txtgonghao_LostFocus()
Dim conlogin As New ADODB.Connection
Dim rstlogin As New ADODB.Recordset

If Len(Trim(txtgonghao.Text)) <> 0 Then
With conlogin
If .State = adStateOpen Then
   .Close
End If
   .Provider = "microsoft.jet.oledb.4.0"
   .ConnectionString = App.Path & "\jinbin.mdb"
   .Open
End With

With rstlogin
If .State = adStateOpen Then
   .Close
End If
   .LockType = adLockReadOnly
   .CursorLocation = adUseClient
   .CursorType = adOpenDynamic (科教范文网 Lw.nsEAc.com编辑整理)
   .ActiveConnection = conlogin
   .Source = "select userid,username,userpassword,userjibie from userinfo where userid='" & Trim(txtgonghao.Text) & "'"
   .Open
If .RecordCount <> 0 Then
Do Until .EOF
txtusername.Text = Trim(.Fields!UserName.Value)
flagpassword = Trim(.Fields!userpassword.Value)
flagadmin = Trim(.Fields!userjibie.Value)
.MoveNext
Loop
Else
MsgBox "输入的工号非法,请重新输入", vbOKOnly
txtgonghao.Text = ""
txtgonghao.SetFocus
Exit Sub
End If
End With
End If
End Sub

 

 


2:添加用户界面设计:

代码设计:
Private Sub cmdadd_Click()
Dim conuser As New ADODB.Connection
Dim cmduser As New ADODB.Command
Dim rstuser As New ADODB.Recordset
Dim strcnn As String

'输入数据进行验证
If Len(Trim(txtuser.Text)) = 0 Then
MsgBox "用户名没有输入,请输入!", vbOKOnly
Exit Sub
Else
txtuser.Text = CStr(Trim(txtuser.Text))
End If

If Len(Trim(txtgonghao.Text)) = 0 Then
MsgBox "工号没有输入,请输入!", vbOKOnly
Exit Sub
Else
txtgonghao.Text = CStr(Trim(txtgonghao.Text))
End If
 
If Len(Trim(txtpassword.Text)) = 0 Then
MsgBox "密码没有输入,请输入!", vbOKOnly
Exit Sub
Else
txtpassword.Text = CStr(Trim(txtpassword.Text))
End If

If Len(Trim(txtpassword2.Text)) = 0 Then
MsgBox "请输入确认密码!", vbOKOnly
Exit Sub
Else
txtpassword2.Text = CStr(Trim(txtpassword2.Text))
End If

If txtpassword.Text <> txtpassword2.Text Then
MsgBox "确认密码和第一次输入的密码不同,请重新输入!", vbOKOnly
Exit Sub
End If

strcnn = "insert into userinfo(username,userid,userpassword,userjibie)values('" & txtuser & "','" & txtgonghao & "','" & txtpassword & "','" & Comboqx.Text & "')"

(转载自科教范文网http://fw.nseac.com)

 
With conuse
上一篇:人力资源管理系统+论文+VB(一)毕业论文 下一篇:没有了