?? teacher.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 8985
ClientLeft = 165
ClientTop = 855
ClientWidth = 11400
LinkTopic = "Form1"
ScaleHeight = 8985
ScaleWidth = 11400
StartUpPosition = 3 '窗口缺省
WindowState = 2 'Maximized
Begin VB.CommandButton Command7
Caption = "更改記錄"
Height = 495
Left = 6240
TabIndex = 13
Top = 7440
Width = 1215
End
Begin VB.CommandButton Command6
Caption = "退出系統"
Height = 495
Left = 10200
TabIndex = 12
Top = 7440
Width = 1215
End
Begin VB.CommandButton Command5
Caption = "刪除記錄"
Height = 495
Left = 8280
TabIndex = 11
Top = 7440
Width = 1215
End
Begin VB.CommandButton Command4
Caption = "更新工資"
Height = 495
Left = 4200
TabIndex = 10
Top = 7440
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "顯示"
Height = 495
Left = 240
TabIndex = 9
Top = 7440
Width = 1215
End
Begin VB.TextBox Text6
Height = 495
Left = 9480
TabIndex = 7
Top = 9360
Width = 2055
End
Begin VB.TextBox Text5
Height = 495
Left = 6960
TabIndex = 6
Top = 9360
Width = 2295
End
Begin VB.TextBox Text4
Height = 495
Left = 4560
TabIndex = 5
Top = 9360
Width = 2055
End
Begin VB.TextBox Text3
Height = 495
Left = 2400
TabIndex = 4
Top = 9360
Width = 1935
End
Begin VB.TextBox Text2
Height = 495
Left = 240
TabIndex = 3
Top = 9360
Width = 1815
End
Begin VB.CommandButton Command2
Caption = "增添記錄"
Height = 495
Left = 240
TabIndex = 2
Top = 8640
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "單個查詢"
Height = 495
Left = 2280
TabIndex = 1
Top = 7440
Width = 1215
End
Begin VB.ListBox List1
Height = 6360
ItemData = "teacher.frx":0000
Left = 240
List = "teacher.frx":0002
TabIndex = 0
Top = 720
Width = 12255
End
Begin MSAdodcLib.Adodc Adodc1
Height = 735
Left = 12600
Top = 720
Visible = 0 'False
Width = 2775
_ExtentX = 4895
_ExtentY = 1296
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 = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=教師基本信息表;Data Source=LEON"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=教師基本信息表;Data Source=LEON"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "SELECT * FROM 工資表"
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
Caption = "從下面得文本框內,分別輸入序號,姓名,入校時間,贍養人數,原工資的值。點擊增添記錄按鈕,進行增添記錄操作"
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 240
TabIndex = 8
Top = 8040
Width = 9375
End
Begin VB.Menu about
Caption = "關于"
Index = 1
Begin VB.Menu edition
Caption = "版本"
End
Begin VB.Menu exit
Caption = "退出"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Firstupdate As Integer
Public Firstadd As Integer
Private Sub Command1_Click()
Form2.Show
End Sub
'添加模塊
Private Sub Command2_Click()
If Firstadd = 1 Then
Me.Text2.Text = "在此輸入序號"
Me.Text3.Text = "在此輸入姓名"
Me.Text4.Text = "在此輸入入校時間"
Me.Text5.Text = "在此輸入贍養人數"
Me.Text6.Text = "在此輸入工資"
MsgBox "在根據方框內的提示正確輸入"
Me.Text2.Text = ""
Me.Text3.Text = ""
Me.Text4.Text = ""
Me.Text5.Text = ""
Me.Text6.Text = ""
End If
Me.Text2.SetFocus
If Firstadd = 1 Then
Firstadd = Firstadd + 1
Exit Sub
End If
If Me.Text2.Text = "" Or Me.Text3.Text = "" Or Me.Text4 = "" Or Me.Text6.Text = "" Then
MsgBox "在方框內完整地輸入要插入的信息"
Else
If Not IsNumeric(Me.Text2.Text) Or Not IsNumeric(Me.Text5.Text) Or Not IsNumeric(Me.Text6.Text) Then
MsgBox "插入值類型不匹配.增添記錄失敗"
GoTo error
End If
If Int(Me.Text5.Text) > 128 Then
MsgBox "贍養人數不能超過128"
GoTo error
End If
If Len(Me.Text3.Text) > 20 Then
MsgBox "姓名字長不超過20"
GoTo error
End If
If Len(Me.Text2.Text) > 9 Or Len(Me.Text6.Text) > 9 Then
MsgBox "序號或工資大小越界"
GoTo error
End If
If Not IsDate(Me.Text4.Text) Then
MsgBox "日期格式不能識別"
GoTo error
End If
'若游標打開 ,則關閉他,重新用查詢語句打開游標
If ResOpen = 1 Then
RES.Close
ResOpen = 0
ResClose = 1
End If
'用查詢語句打開游標
RES.ActiveConnection = Comsalary
RES.Source = "select * from 工資表"
RES.Open
ResOpen = 1
ResClose = 0
'判斷是否有重復字段
For i = 0 To Me.List1.ListCount - 2
If Int(Me.Text2.Text) = RES.Fields("序號") Then
MsgBox "在關鍵字段插入了重復值,插入失敗"
GoTo error
End If
RES.MoveNext
Next
'插入記錄
If ResOpen = 1 Then
RES.Close
ResClose = 1
ResOpen = 0
RES.Source = "insert 工資表(序號,姓名,入校時間,贍養人數,原工資) values ( '" & Me.Text2.Text & "', '" & Me.Text3.Text & "','" & Me.Text4.Text & "','" & Me.Text5.Text & "', '" & Me.Text6.Text & "') "
RES.Open
ResOpen = 1
ResClose = 0
MsgBox "成功添加"
ResOpen = 0
ResClose = 1
Me.Adodc1.Refresh
Call showdata
End If
End If
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -