| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 706 人关注过本帖
标题:请教Executeqx 意思,请各位大侠帮忙
只看楼主 加入收藏
Bendis
Rank: 1
来 自:福建厦门
等 级:新手上路
帖 子:47
专家分:0
注 册:2010-4-2
结帖率:93.75%
收藏
已结贴  问题点数:18 回复次数:2 
请教Executeqx 意思,请各位大侠帮忙
Public Function Executeqx(ByVal txt As Integer) As String
    Dim 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 是什么用,意义是什么,请速度帮吗,在线等待。
搜索更多相关主题的帖子: Executeqx 
2010-05-08 16:57
风吹过b
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:364
帖 子:4943
专家分:30067
注 册:2008-10-15
收藏
得分:18 
Executeqx  是自定义函数。
函数可以带返回值。

对函数返回值,在VB6里,定义是对函数体内对函数名赋值就是确定返回值。
当程序执行到 end funtion 或 exit funtion 时,就结束函数运行,然后把函数名所代表的值返回给调用者。

这种封装的函数,你可以理解为一种黑盒。

----------------------------------------
从代码上来看,这个函数是用来校验用户的。

授人于鱼,不如授人于渔
早已停用QQ了
2010-05-08 17:18
Bendis
Rank: 1
来 自:福建厦门
等 级:新手上路
帖 子:47
专家分:0
注 册:2010-4-2
收藏
得分:0 
  明白 谢谢啊
2010-05-11 10:31
快速回复:请教Executeqx 意思,请各位大侠帮忙
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014318 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved