分类：电脑/网络-程序设计
问题：　那位大侠有密码对话框的设计程序（ＶＢ）根据用户自己的意愿进行用 
根据用户自己的意愿进行用户密码修改，像用户密码的设计一样的VB程序
回答：登录代码:Option ExplicitDim yonghu As StringDim mima As StringPrivate Sub cmdOK_Click()'检查正确的密码If txtPassword = mima And txtUserName = yonghu Then'将代码放在这里传递Form2.ShowForm2.Label1.Caption = "登录成功!"ElseMsgBox "无效的密码，请重试!", , "登录"txtPassword.SetFocusSendKeys "{Home}+{End}"End IfEnd SubPrivate Sub Form_Load()'连接存放用户名密码的表Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\data_ref\ b;Persist Security Info=False"Adodc1.RecordSource = "select * from ps"Adodc1.Refreshyonghu = Adodc1.Recordset(0) '传递用户名mima = Adodc1.Recordset(1) '传递密码End Sub修改部分的代码:Option ExplicitDim yonghu As StringDim mima As StringDim ym As VariantPrivate Sub cmdOK_Click()ym = MsgBox("修改用户名密码!", vbOK, "修改") 'If ym = vbOK ThenAdodc1.Recordset(0) = Text1 '传递新用户名Adodc1.Recordset(1) = Text2 '传递新密码Adodc1.Recordset.Update '修改数据处理Form2.ShowForm2.Label1.Caption = "成功修改用户名和密码!"ElseUnload MeEnd IfEnd SubPrivate Sub Form_Load()Text1 = "": Text2 = ""Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\data_ref\ b;Persist Security Info=False"Adodc1.RecordSource = "select * from ps"Adodc1.Refreshyonghu = Adodc1.Recordset(0)mima = Adodc1.Recordset(1)End SubPrivate Sub txtPassword_KeyPress(KeyAscii As Integer)If KeyAscii = 13 And txtPassword = mima Then '核实原密码Text1.Enabled = TrueText2.Enabled = TrueText1.SetFocusEnd IfEnd SubPrivate Sub txtUserName_KeyPress(KeyAscii As Integer)If KeyAscii = 13 And txtUserName = yonghu Then '核实原用户名txtPassword.SetFocusEnd IfEnd Sub工程文件见 DB4.MDB数据库存放D:\DATA_REF目录夹,原用户名和密码分别为:user和111111