注册 登录
编程论坛 VB6论坛

总是遇到对象关闭时不允许操作,下面是代码,在线求指点!!

阿白。。。 发布于 2013-07-01 14:28, 483 次点击
Private Sub Command1_Click()
   If txtUser = "" Then
        MsgBox "请输入用户名", vbOKOnly, "提示"
        txtUser.SetFocus
        Exit Sub
    End If
    '判断2次密码是否一致
    If txtPassw1 <> txtPassw2 Then
        MsgBox "两次输入密码不一样,请重新输入", vbOKOnly, "提示"
        txtPassw1.SetFocus
        Exit Sub
    End If
   Adodc1.RecordSource = "INSERT INTO 系统用户登录表 VALUES('" & txtUser.Text & "','" & txtPassw1.Text & "','0')"
   Adodc1.Refresh(就在这里出问题,哭。。。)
   Unload Me
End Sub
2 回复
#2
阿白。。。2013-07-01 14:41
而且事实上SQL里数据表的记录又添加成功了。。。到底是怎么回事额。。。
#3
风吹过b2013-07-01 16:32
Adodc1.RecordSource = "INSERT INTO 系统用户登录表 VALUES('" & txtUser.Text & "','" & txtPassw1.Text & "','0')"
执行插入操作,无 数据返回。对象自动关闭。

所以这句就出问题
Adodc1.Refresh(就在这里出问题,哭。。。)
1