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

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

2013-05-08 18:11
导读:r If .State = adStateOpen Then .Close End If .Provider = "microsoft.jet.oledb.4.0" .ConnectionString = App.Path "\jinbin.mdb" .ConnectionTimeout = 10 .Open End With With cmduser .ActiveConnection = co
r
If .State = adStateOpen Then
   .Close
End If
   .Provider = "microsoft.jet.oledb.4.0"
   .ConnectionString = App.Path & "\jinbin.mdb"
   .ConnectionTimeout = 10
   .Open
End With

With cmduser
   .ActiveConnection = conuser
   .CommandType = adCmdText
   .CommandText = strcnn
   .Execute
End With

MsgBox "添加用户信息到数据库的操作成功", vbOKOnly, "确认框"
txtuser.Text = ""
txtgonghao.Text = ""
txtpassword.Text = ""
txtpassword2.Text = ""

strcnn = "select userid as 用户工号, username as 用户姓名,userjibie as 用户级别 from userinfo"

With rstuser
   .CursorLocation = adUseClient
   .CursorType = adOpenStatic
   .LockType = adLockOptimistic
   .ActiveConnection = conuser
   .Open strcnn, Options:=adCmdText
   Set Adouser.Recordset = rstuser
   dtguserinfo.ReBind
End With


End Sub

Private Sub cmdcancel_Click()
txtuser.Text = ""
txtgonghao.Text = ""
txtpassword.Text = ""
txtpassword2.Text = ""
End Sub

 

Private Sub cmddel_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
 
strcnn = "delete from userinfo where username='" & txtuser & "' and userid='" & txtgonghao & "'"

(科教作文网http://zw.ΝsΕac.cOM编辑)


 With conuser
        If .State = adStateOpen Then
           .Close
        End If
        .Provider = "microsoft.jet.oledb.4.0"
        .ConnectionString = App.Path & "\jinbin.mdb"
        .ConnectionTimeout = 10
        .Open
 End With

 With cmduser
        .ActiveConnection = conuser
        .CommandType = adCmdText
        .CommandText = strcnn
        .Execute
 End With

MsgBox "删除用户成功!", vbOKOnly
txtuser.Text = ""
txtgonghao.Text = ""

strcnn = "select userid as 用户工号, username as 用户姓名,userjibie as 用户级别 from userinfo"

With rstuser
   .CursorLocation = adUseClient
   .CursorType = adOpenStatic
   .LockType = adLockOptimistic
   .ActiveConnection = conuser
   .Open strcnn, Options:=adCmdText
   Set Adouser.Recordset = rstuser
    dtguserinfo.ReBind
End With
End Sub

Private Sub cmdexit_Click()
adduserfrm.Hide
Unload Me
End Sub

 

Private Sub Form_Load()

Comboqx.AddItem "高级用户"
Comboqx.AddItem "一般用户"

Dim conuser As New ADODB.Connection
Dim cmduser As New ADODB.Command
Dim rstuser As New ADODB.Recordset
Dim strcnn As String

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