请教Executeqx 意思,请各位大侠帮忙
Public Function Executeqx(ByVal txt As Integer) As StringDim sql As String
Dim mycon As ADODB.Connection '定义一个ADOOB连接
Dim rst As ADODB.Recordset '定义返回集合
Set mycon = New ADODB.Connection
mycon.ConnectionString = connstring '连接数据库
mycon.Open
Set rst = New ADODB.Recordset
sql = "select admin from userinfo where username='" & username & "'"
rst.Open Trim(sql), mycon, adOpenKeyset, adLockOptimistic
If rst.EOF = True Then
MsgBox "非法用户!", vbExclamation + vbOKOnly, "警告"
Executeqx = "nothing"
Exit Function
End If
If rst.Fields(0) = "y" Then
Executeqx = "admin"
Exit Function
End If
rst.Close
sql = "select readonly from userinfo where username='" & username & "'"
rst.Open Trim(sql), mycon, adOpenKeyset, adLockOptimistic
If rst.Fields(0) = "y" Then
Executeqx = "readonly"
Exit Function
End If
Select Case txt
Case 1
sql = "select qx1 from userinfo where username='" & username & "'"
Case 2
sql = "select qx2 from userinfo where username='" & username & "'"
Case 3
sql = "select qx3 from userinfo where username='" & username & "'"
Case 4
sql = "select qx4 from userinfo where username='" & username & "'"
End Select
On Error GoTo exectuesql_error
Set rst = New ADODB.Recordset
rst.Open Trim(sql), mycon, adOpenKeyset, adLockOptimistic
If rst.Fields(0) = "y" Then
Executeqx = "true"
Else
Executeqx = "false"
End If
exectuesql_exit:
Set rst = Nothing
Set mycon = Nothing
Exit Function
exectuesql_error:
Resume exectuesql_exit
End Function
的 Executeqx 是什么用,意义是什么,请速度帮吗,在线等待。