vb程序.docVIP

  • 5
  • 0
  • 约3.63千字
  • 约 4页
  • 2017-08-26 发布于河南
  • 举报
部件添加 1.m add data control… 2.m common dialog… 单击“工程”→“引用… 4m activex data object 2.5… 1外部模块声明 Public u as string Public conn as new adodb.connection 修改adodc属性 m jet 4.0 ole 建立(sub main()+复制生成的字符串+frmlogan.show) 2登录 text2.text.passwordchar属性加* Private Sub Command1_Click() (取消) Unload frmlogin End Sub Private Sub Command2_Click() (登录) Dim rs As New ADODB.Recordset rs.Open select * from yhxx where 用户名= Text1.Text , conn, adOpenDynamic, adLockPessimistic If Text1.Text = Then MsgBox 请输入用户名!, vbInformation, 提示 Text1.SetFocus Else If Text2.Text = Then MsgBox 请输入密码!, vbInformation, 提示 Text2.SetFocus Else If rs.EOF = True Then MsgBox 用户名错误!, vbInformation, 提示 Else If rs(密码) Text2.Text Then MsgBox 密码错误!, vbInformation, 提示 Else MsgBox 登陆成功!, vbInformation, 提示 u = Text1.Text Form1.Show Unload Me End If End If End If End If End Sub Private Sub Form_Load() (窗口大小) Me.Height = 5000 Me.Width = 7000 End Sub Private Sub Label4_Click() (注册) Form3.Show End Sub 3注册 Private Sub Command1_Click() (确定注册) Dim rs As New ADODB.Recordset ‘conn.Open Provider=Microsoft.Jet.OLEDB.4.0;Data Source= App.Path \data.mdb; rs.Open select * from yhxx, conn, adOpenDynamic, adLockPessimistic rs.AddNew If Text1.Text = Then MsgBox 请输入用户名!, vbInformation, 提示 Text1.SetFocus Else If Text2.Text = Then MsgBox 请输入密码!, vbInformation, 提示 Text2.SetFocus Else If Text2.Text Text3.Text Then MsgBox 请输入确定密码!, vbInformation, 提示 Else If rs(用户名) = Text1.Text Then MsgBox 该用户名已经被注册过!, vbInformation, 提示 Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text) Else rs(用户名) = Text1.Text rs(密码) = Text2.Text MsgBox 注册成功!, vbInformation, 提示 rs.Update Unload Me frmlogin.Show End If End If End If End If End Sub Private Sub Command2_Click() (取消注册) Unload Me frmlogin.Show End Sub 4系统功能 Dim k As String (外部变量) Private Sub Command1_Click() (系统锁定) Frame4.Visible = False Frame5.Visible = True Command2.Enabled = False Command3.Enabled = False Command4.Enabled = False Command1.Enabled = False Command6.Enabled = False Tex

文档评论(0)

1亿VIP精品文档

相关文档