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

药品库房管理系统+VB开题报告答辩PPT外文翻译(一(4)

2013-06-15 01:35
导读:ring Public username As String Public userright As String Public conn As String Private Sub Command1_Click() Dim password As String Dim respond As String username = Text1.Text password = Text2.Text On
ring
Public username As String
Public userright As String
Public conn As String

Private Sub Command1_Click()
Dim password As String
Dim respond As String
username = Text1.Text
password = Text2.Text
On Error GoTo err1
Adodc1.ConnectionString = conn
Adodc1.RecordSource = "select * from usertab where 用户名=" & "'" & username & "'" & " and " & "密码=" & "'" & password & "'"
Adodc1.Refresh
If Adodc1.Recordset.AbsolutePosition = adPosUnknown Then
respond = MsgBox("用户名或密码错误,请重新输入!", vbOKOnly, "警告")
If respond <> vbOKOnly Then
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""
username = ""
password = ""
End If
Else
userright = Adodc1.Recordset.Fields("权限")
Unload frmlogin
frmmain.Show
End If
Exit Sub
err1:
MsgBox "系统配置错误!无法与服务器连接!"
userright = "0"
Unload Me
frmsysset.Show
End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
'conn = Frmstart.pconn
conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\his.mdb;Persist Security Info=False"
End Sub

 

 

 

用户修改密码界面设计:

代码设计:
Private Sub Command1_Click()
On Error GoTo err1
username = frmlogin.username
If Text1.Text <> "" And Text2.Text <> "" Then
Adodc1.RecordSource = "select * from usertab where 用户名='" & username & "' and  密码=" & "'" & Text1.Text & "'"
Adodc1.Refresh
If Adodc1.Recordset.AbsolutePosition = adPosUnknown Then
MsgBox "旧密码错误!"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus (科教作文网http://zw.ΝsΕac.cOM编辑)
Else
Adodc1.Recordset.Fields("密码") = Text2.Text
Adodc1.Recordset.Update
MsgBox "密码修改成功!"
Text1.Text = ""
Text2.Text = ""
End If
Else
MsgBox "新旧密码均不得为空!"
Text1.SetFocus
End If
Exit Sub
err1:
MsgBox "远程服务器连接失败!"
End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End Sub

Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error GoTo err2
chpwd.Top = (frmmain.Height - chpwd.Height) / 2 - 500
chpwd.Left = (frmmain.Width - chpwd.Width) / 2
Adodc1.ConnectionString = frmlogin.conn
Text1.Text = ""
Text2.Text = ""
Exit Sub
err2:
MsgBox "远程服务器连接失败!"
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmmain.StatusBar1.Panels(2) = "目前没有窗口被激活"
End Sub
Private Sub Form_Activate()
frmmain.StatusBar1.Panels(2) = "活动窗口:" & chpwd.Caption
End Sub

 

 

3,关于界面设计:


代码设计:
Private Sub cmdOK_Click()
  Unload Me
End Sub

Private Sub Form_Load()
frmAbout.Top = (frmmain.Height - frmAbout.Height) / 2 - 500
frmAbout.Left = (frmmain.Width - frmAbout.Width) / 2
    Me.Caption = "关于" & App.Title
  
    lblTitle.Caption = App.Title
    End Sub

Public Sub StartSysInfo()
    On Error GoTo SysInfoErr
 
    Dim rc As Long
    Dim SysInfoPath As String
   
    ' 试图从注册表中获得系统信息程序的路径及名称...
    If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then (科教范文网http://fw.NSEAC.com编辑发布)
    ' 试图仅从注册表中获得系统信息程序的路径...
    ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then
 &nb

上一篇:学生信息管理系统+VB代码+开题报告及一稿二稿 下一篇:没有了