设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 651|回复: 1
打印 上一主题 下一主题

[其它] 能不能帮我解说一下这段代码

[复制链接]

点击这里给我发消息

跳转到指定楼层
1#
发表于 2004-3-12 04:24:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Option Compare Database
Option Explicit

Type FormLimit
    Usufruct As Boolean
    Query As Boolean
    MoneyQuery As Boolean
    Edit As Boolean
    MoneyEdit As Boolean
    Report As Boolean
    MoneyReport As Boolean
End Type

Public typFormLimit As FormLimit

Public Sub GetFormLimit(strFormName As String)
On Error GoTo GetFormLimit_Err
    Dim strSubName As String
    Dim rst As New ADODB.Recordset
    Dim cn As New ADODB.Connection
    Dim strSQL As String
   
    Set cn = CurrentProject.Connection
    strSubName = "GetFormLimit"
   
    strSQL = "Select * from tbl权限分配 where 用户名称='" & strUserID & "' And 窗体名称='" & strFormName & "'"
    rst.Open strSQL, cn, adOpenKeyset, adLockPessimistic, 1
   
    typFormLimit.Usufruct = rst!Usufruct
    typFormLimit.Query = rst!Query
    typFormLimit.MoneyQuery = rst!MoneyQuery
    typFormLimit.Edit = rst!Edit
    typFormLimit.MoneyEdit = rst!MoneyEdit
    typFormLimit.Report = rst!Report
    typFormLimit.MoneyReport = rst!MoneyReport
    rst.Close
    Exit Sub
   
GetFormLimit_Err:
    MsgBox err.Description
   
End Sub
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2004-3-12 20:37:00 | 只看该作者
先自定义一个类型 formlimit  
声明变量  typformlimit
定义函数  getformlimit
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-9-27 15:19 , Processed in 0.099444 second(s), 26 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表