以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]按照狐表说明书自定义权限出现错误,求解  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=28344)

--  作者:guoqi1129
--  发布时间:2013/1/26 8:38: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
--  发布时间:2013/1/26 9:13: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