📄 sfyfrm.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form sfyfrm
Caption = "收费员信息"
ClientHeight = 5850
ClientLeft = 60
ClientTop = 345
ClientWidth = 8190
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 5850
ScaleWidth = 8190
Begin VB.CommandButton cmdexit
Caption = "退出"
Height = 495
Left = 5880
TabIndex = 10
Top = 4440
Width = 1335
End
Begin VB.CommandButton cmdcancel
Caption = "取消操作"
Height = 495
Left = 3360
TabIndex = 9
Top = 4440
Width = 1335
End
Begin VB.CommandButton cmdok
Caption = "添加信息"
Height = 495
Left = 960
TabIndex = 8
Top = 4440
Width = 1335
End
Begin MSAdodcLib.Adodc Adosfy
Height = 375
Left = 2760
Top = 3960
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_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 MSDataGridLib.DataGrid Dtgsfy
Bindings = "sfyfrm.frx":0000
Height = 2175
Left = 720
TabIndex = 7
Top = 1560
Width = 6735
_ExtentX = 11880
_ExtentY = 3836
_Version = 393216
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "收费员信息表"
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.ComboBox Combobz
Height = 300
Left = 6000
TabIndex = 6
Text = "一"
Top = 360
Width = 1215
End
Begin VB.TextBox txtid
Height = 375
Left = 3840
TabIndex = 4
Top = 360
Width = 1215
End
Begin VB.TextBox txtname
Height = 375
Left = 1680
TabIndex = 3
Top = 360
Width = 1215
End
Begin VB.Frame Frame1
Caption = "收费员信息"
Height = 1095
Left = 720
TabIndex = 0
Top = 120
Width = 6735
Begin VB.Label Label3
Caption = "班组:"
Height = 375
Left = 4680
TabIndex = 5
Top = 360
Width = 855
End
Begin VB.Label Label2
Caption = "工号:"
Height = 255
Left = 2520
TabIndex = 2
Top = 360
Width = 615
End
Begin VB.Label Label1
Caption = "姓名:"
Height = 375
Left = 360
TabIndex = 1
Top = 360
Width = 735
End
End
End
Attribute VB_Name = "sfyfrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cnnjinbin As New ADODB.Connection
Dim cmdjinbin As New ADODB.Command
Dim rstjinbin As New ADODB.Recordset
Dim strsql As String
Private Sub cmdcancel_Click()
txtname.Text = ""
txtid.Text = ""
End Sub
Private Sub cmdexit_Click()
sfyfrm.Hide
Unload Me
End Sub
Private Sub cmdok_Click()
'输入数据进行验证
If Len(Trim(txtname.Text)) = 0 Then
MsgBox "收费员姓名没有输入,请输入!", vbOKOnly
Exit Sub
Else
txtname.Text = CStr(Trim(txtname.Text))
End If
If Len(Trim(txtid.Text)) = 0 Then
MsgBox "收费员工号没有输入,请输入!", vbOKOnly
Exit Sub
Else
txtid.Text = CStr(Trim(txtid.Text))
End If
strsql = "insert into sfyinfo(sxm,gonghao,bz)values('" & txtname & "','" & txtid & "','" & Combobz.Text & "')"
With cnnjinbin
If .State = adStateOpen Then
.Close
End If
.Provider = "microsoft.jet.oledb.4.0"
.ConnectionString = App.Path & "\jinbin.mdb"
.ConnectionTimeout = 10
.Open
End With
With cmdjinbin
.ActiveConnection = cnnjinbin
.CommandType = adCmdText
.CommandText = strsql
.Execute
End With
MsgBox "添加用户信息到数据库的操作成功", vbOKOnly, "确认框"
txtname.Text = ""
txtid.Text = ""
strsql = "select sxm as 收费员姓名, gonghao as 收费员工号,bz as 班组 from sfyinfo"
With rstjinbin
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.ActiveConnection = cnnjinbin
.Open strsql, Options:=adCmdText
Set Adosfy.Recordset = rstjinbin
Dtgsfy.ReBind
End With
End Sub
Private Sub Form_Load()
With sfyfrm
.Width = 8500
.ScaleWidth = 8400
.ScaleHeight = 7200
.Height = 6000
End With
With cnnjinbin
If .State = adStateOpen Then
.Close
End If
.Provider = "microsoft.jet.oledb.4.0"
.ConnectionString = App.Path & "\jinbin.mdb"
.ConnectionTimeout = 10
.Open
End With
strsql = "select sxm as 收费员姓名, gonghao as 收费员工号,bz as 班组 from sfyinfo"
With rstjinbin
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.ActiveConnection = cnnjinbin
.Open strsql, Options:=adCmdText
Set Adosfy.Recordset = rstjinbin
Dtgsfy.ReBind
End With
Combobz.AddItem "一"
Combobz.AddItem "二"
Combobz.AddItem "三"
Combobz.AddItem "四"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -