谁能帮我看看哪错了

来源:百度知道 编辑:UC知道 时间:2024/05/05 10:10:23
Dim a As String = Me.TextBox1.Text
Dim x As String = Me.TextBox2.Text
Dim y As String = Me.TextBox3.Text
Dim i As Integer
cn.Close()

If x = "" Or y = "" Or a = "" Then
MsgBox("请输入密码", MsgBoxStyle.OkOnly, "提示")
ElseIf x <> y Then
MsgBox("密码与确认码不符,请重新输入!", MsgBoxStyle.OkOnly, "")
Me.TextBox3.Focus()
ElseIf x <> "" And y <> "" Then
Dim cmd As New OleDb.OleDbCommand
cmd.CommandText = ("update 信息 set 密码='" & x & "''")
cn.Open()
If MsgBox("确认密码修改吗?", MsgBoxStyle.OkCancel, "提示") = MsgBoxResult.Ok Then
i = cmd.ExecuteNonQuery()
If i = 1 Then
MsgBox("密码修改

vb 不能在声明的时候给值。
Dim a As String = Me.TextBox1.Text
Dim x As String = Me.TextBox2.Text
Dim y As String = Me.TextBox3.Text
应该改成
Dim a As String
Dim x As String
Dim y As String
a= Me.TextBox1.Text
x= Me.TextBox2.Text
y= Me.TextBox3.Text

把你所有的MsgBox句子的括号去掉,写成 Msgbox "xxxxx","xxxx"的形式

或者写成i=MsgBox(xxxx,xxx)的形式。。。

If MsgBox("确认密码修改吗?", MsgBoxStyle.OkCancel, "提示") = MsgBoxResult.Ok Then....这句不用

如果这句也错的话,那写成

i=MsgBox("确认密码修改吗?", MsgBoxStyle.OkCancel, "提示")
if i=MsgBoxResult.Ok Then