Foxtable(狐表)用户栏目专家坐堂 → [求助]仿照说明书做的权限管理,代码出现错误。


  共有6928人关注过本帖树形打印复制链接

主题:[求助]仿照说明书做的权限管理,代码出现错误。

帅哥哟,离线,有人找我吗?
guoqi1129
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:婴狐 帖子:65 积分:607 威望:0 精华:0 注册:2012/6/14 9:32:00
[求助]仿照说明书做的权限管理,代码出现错误。  发帖心情 Post By:2013/1/25 20:43:00 [只看该作者]

If Vars("用户管理") = "增加用户" Then
    
    Dim username As WinForm.TextBox = e.Form.Controls("用户名").value
    Dim password As WinForm.TextBox = e.Form.Controls("密码").value
    Dim usergroup As WinForm.ComboBox = e.Form.Controls("属性").value
    Dim cmd As New SQLCommand
    cmd.C
    If username = "" OrElse usergroup = "" Then
        Messagebox.show("请输入用户名和用户分组!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
        Return
    End If
    cmd.CommandText = "Insert Into {用户表} ([用户名],[属性],[密码]) Values ('"
    cmd.CommandText = cmd.CommandText & username & "','" & usergroup & "','" & password & "')"
    If cmd.ExecuteNonQuery = 1 Then '返回1表示增加成功
        With Forms("用户管理").Controls("ListBox1")
            .Items.Add(username)
            .SelectedIndex = .Items.Count -1
        End With
    Else
        Messagebox.show("增加用户失败, 可能存在同名用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    End If
    
End If
代码保存时显示编译错误:重载决策失败,原因是没有可访问的“=“可以调用这些参数,错误代码是标黄代码。

 回到顶部
帅哥哟,离线,有人找我吗?
lin_hailun
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2013/1/26 13:51:00 [只看该作者]

 已在你的另一个帖子里回答了。

  Dim username As String = e.Form.Controls("用户名").value
  Dim password As String = e.Form.Controls("密码").value
  Dim usergroup As String = e.Form.Controls("属性").value


 回到顶部