?? frmadminmemo.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form FrmAdminMemo
BorderStyle = 3 'Fixed Dialog
Caption = "用戶資料維護"
ClientHeight = 3855
ClientLeft = 45
ClientTop = 330
ClientWidth = 7005
Icon = "FrmAdminMemo.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3855
ScaleWidth = 7005
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox TxtShouJi
Height = 390
Left = 1140
TabIndex = 4
Top = 2640
Width = 2655
End
Begin VB.CommandButton CmdClose
Cancel = -1 'True
Caption = "關閉(&C)"
Height = 375
Left = 4020
TabIndex = 7
Top = 3225
Width = 1095
End
Begin VB.TextBox TxtUName
Height = 390
Left = 1140
TabIndex = 0
Top = 225
Width = 2655
End
Begin VB.OptionButton OptionMan
Caption = "男"
Height = 255
Left = 1140
TabIndex = 9
Top = 825
Value = -1 'True
Width = 495
End
Begin VB.OptionButton OptionFemail
Caption = "女"
Height = 255
Left = 1860
TabIndex = 8
Top = 825
Width = 495
End
Begin VB.TextBox TxtUDiZhi
Height = 390
Left = 1140
TabIndex = 1
Top = 1185
Width = 2655
End
Begin VB.TextBox TxtUMail
Height = 390
Left = 1140
TabIndex = 2
Top = 1665
Width = 2655
End
Begin VB.TextBox TxtUDianHua
Height = 390
Left = 1140
TabIndex = 3
Top = 2145
Width = 2655
End
Begin VB.TextBox TxtUMemo
Height = 2775
Left = 4020
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 5
Top = 255
Width = 2655
End
Begin VB.CommandButton CmdRegMe
Caption = "修改(&D)"
Height = 375
Left = 1140
TabIndex = 6
Top = 3225
Width = 1095
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 5340
Top = 3225
Visible = 0 'False
Width = 1215
_ExtentX = 2143
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "手機:"
Height = 180
Left = 330
TabIndex = 16
Top = 2760
Width = 540
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "姓名:"
Height = 180
Left = 330
TabIndex = 15
Top = 315
Width = 540
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "性別:"
Height = 180
Left = 330
TabIndex = 14
Top = 780
Width = 540
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "地址:"
Height = 180
Left = 330
TabIndex = 13
Top = 1275
Width = 540
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "E-mail:"
Height = 180
Left = 150
TabIndex = 12
Top = 1755
Width = 720
End
Begin VB.Label Label29
AutoSize = -1 'True
Caption = "電話:"
Height = 180
Left = 330
TabIndex = 11
Top = 2235
Width = 540
End
Begin VB.Label Label30
AutoSize = -1 'True
Caption = "人生格言:"
Height = 180
Left = 3000
TabIndex = 10
Top = 825
Width = 900
End
End
Attribute VB_Name = "FrmAdminMemo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdClose_Click()
Unload Me
End Sub
Private Sub CmdRegMe_Click()
If TxtUName.Text = "" Then
MsgBox "請填寫你的姓名!", vbOKOnly + vbExclamation, "個人資料"
TxtUName.SetFocus
Exit Sub
End If
If TxtUDiZhi.Text = "" Then
MsgBox "請填寫你的地址!", vbOKOnly + vbExclamation, "個人資料"
TxtUDiZhi.SetFocus
Exit Sub
End If
If TxtUMail.Text = "" Then TxtUMail.Text = "無"
If TxtUDianHua.Text = "" Then TxtUDianHua.Text = "無"
If TxtUMemo.Text = "" Then TxtUMemo.Text = "無"
Adodc1.Recordset!姓名 = TxtUName.Text
If OptionMan.Value Then
Adodc1.Recordset!性別 = "男"
Else
Adodc1.Recordset!性別 = "女"
End If
Adodc1.Recordset!地址 = TxtUDiZhi.Text
Adodc1.Recordset!手機 = TxtShouJi.Text
Adodc1.Recordset!電子郵件 = TxtUMail.Text
Adodc1.Recordset!電話 = TxtUDianHua.Text
Adodc1.Recordset!人生格言 = TxtUMemo.Text
Adodc1.Recordset.Update
MsgBox "個人資料修改成功!", vbOKOnly + vbInformation, "個人資料"
Exit Sub
errEnd:
MsgBox Err.Description, vbOKOnly + vbExclamation, "打開數據庫出錯"
End Sub
Private Sub Form_Activate()
On Error GoTo errEnd
Me.Caption = UserShenFen & "資料維護"
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from [員工表] where [員工帳號]=""" & userName & """"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
TxtUName.Text = Adodc1.Recordset!姓名 & ""
If Adodc1.Recordset!性別 = "男" Then
OptionMan.Value = True
Else
OptionFemail.Value = True
End If
TxtShouJi.Text = Adodc1.Recordset!手機 & ""
TxtUDiZhi.Text = Adodc1.Recordset!地址 & ""
TxtUMail.Text = Adodc1.Recordset!電子郵件 & ""
TxtUDianHua.Text = Adodc1.Recordset!電話 & ""
TxtUMemo.Text = Adodc1.Recordset!人生格言 & ""
Else
MsgBox "用戶身份驗證錯!請重新登陸!", vbOKOnly + vbExclamation, "員工資料"
End If
Else
MsgBox "用戶資料丟失!請與程序員聯系!", vbOKOnly + vbExclamation, "個人資料"
CmdRegMe.Enabled = False
End If
Exit Sub
errEnd:
MsgBox Err.Description, vbOKOnly + vbExclamation, "打開數據庫出錯"
End Sub
Private Sub Form_Load()
Dim dbName As String
Dim connSTR As String
On Error GoTo errEnd
dbName = App.Path
If Right(dbName, 1) <> "\" Then dbName = dbName + "\"
dbName = dbName + "DataBase\WFSSDataBase.mdb"
connSTR = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbName & ";Persist Security Info=False"
Adodc1.ConnectionString = connSTR
Exit Sub
errEnd:
MsgBox Err.Description, vbOKOnly + vbExclamation, "打開數據庫出錯"
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -