📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 2040
ClientLeft = 240
ClientTop = 9180
ClientWidth = 6585
LinkTopic = "Form1"
ScaleHeight = 2040
ScaleWidth = 6585
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'SAMPLE APP USING THE SqlSecurity dll
Private oSec As SQLSecurity.CSQLSecurity
Private Sub Form_Load()
Dim sUser As String
Set oSec = New SQLSecurity.CSQLSecurity
'when form loads, call the .dll and fill out the data model with all rolls for the database,
'and users for each roll
If oSec.LoadSecurity("SQLSERVER_NAME", "ADMIN_ID", "ADMIN_PW", "DATABASE_NAME") = False Then
MsgBox "There was an error loading security data"
Set oSec = Nothing
End
End If
'Have User login to app
sUser = InputBox("Please enter your NT Login", App.Title & " Login")
If oSec.CheckUserRightsToDatabase(sUser) = False Then
MsgBox "You do not have rights to run this app", vbCritical + vbOKOnly, App.Title
End If
'Check to see if user has rights to that roll
If oSec.CheckUserRightsToRoll(sUser, "RollName1") = True Then
'run queries RollName1 as rights to
'do configuration
'whatever
End If
If oSec.CheckUserRightsToRoll(sUser, "RollName2") = True Then
'run queries RollName2 as rights to
'do configuration
'whatever
End If
If oSec.CheckUserRightsToRoll(sUser, "RollName3") = True Then
'run queries RollName3 as rights to
'do configuration
'whatever
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set oSec = Nothing
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -