S
songmk
Unregistered / Unconfirmed
GUEST, unregistred user!
我还不明白。 我太苯了????
---------------------------------
不用密碼,用權限,在登錄時存On_load加入
Option Compare Database
Sub SetStartupProperties()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "Customers"
ChangeProperty "StartupShowDBWindow", DB_Boolean, False
ChangeProperty "StartupShowStatusBar", DB_Boolean, False
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
ChangeProperty "AllowFullMenus", DB_Boolean, True
ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
ChangeProperty "AllowSpecialKeys", DB_Boolean, True
ChangeProperty "AllowBypassKey", DB_Boolean, True
End Sub
Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then ' 找不到屬性。
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' 未知的錯誤。
ChangeProperty = False
Resume Change_Bye
End If
End Function
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
DoCmd.Close
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
Private Sub Command1_Click()
ChangeProperty "AllowBypassKey", DB_Boolean, True
If Me!UesrName = "wyn" And Me!Password = "085477" Then
Else
MsgBox "密碼錯誤"
End If
End Sub
Private Sub Command2_Click()
ChangeProperty "AllowBypassKey", DB_Boolean, Flase
DoCmd.Close
End Sub
Private Sub Form_Load()
ChangeProperty "AllowBypassKey", DB_Boolean, False
End Sub
我就是這么做的
---------------------------------
不用密碼,用權限,在登錄時存On_load加入
Option Compare Database
Sub SetStartupProperties()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
ChangeProperty "StartupForm", DB_Text, "Customers"
ChangeProperty "StartupShowDBWindow", DB_Boolean, False
ChangeProperty "StartupShowStatusBar", DB_Boolean, False
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
ChangeProperty "AllowFullMenus", DB_Boolean, True
ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
ChangeProperty "AllowSpecialKeys", DB_Boolean, True
ChangeProperty "AllowBypassKey", DB_Boolean, True
End Sub
Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then ' 找不到屬性。
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' 未知的錯誤。
ChangeProperty = False
Resume Change_Bye
End If
End Function
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
DoCmd.Close
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
Private Sub Command1_Click()
ChangeProperty "AllowBypassKey", DB_Boolean, True
If Me!UesrName = "wyn" And Me!Password = "085477" Then
Else
MsgBox "密碼錯誤"
End If
End Sub
Private Sub Command2_Click()
ChangeProperty "AllowBypassKey", DB_Boolean, Flase
DoCmd.Close
End Sub
Private Sub Form_Load()
ChangeProperty "AllowBypassKey", DB_Boolean, False
End Sub
我就是這么做的