📄 frm_localunits.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frm_LocalUnits
BorderStyle = 1 'Fixed Single
Caption = "本单位信息设置"
ClientHeight = 2700
ClientLeft = 45
ClientTop = 330
ClientWidth = 7140
Icon = "frm_LocalUnits.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2700
ScaleWidth = 7140
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Height = 2625
Left = 45
TabIndex = 0
Top = -15
Width = 7005
Begin VB.Frame Frame2
Height = 2400
Left = 90
TabIndex = 1
Top = 120
Width = 6795
Begin VB.CommandButton cmdExit
Caption = "退出(&E)"
Height = 435
Left = 4995
TabIndex = 15
Top = 1830
Width = 1605
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 120
Top = 1980
Visible = 0 'False
Width = 2370
_ExtentX = 4180
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
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.CommandButton cmdSave
Caption = "更新(&U)"
Height = 435
Left = 3405
TabIndex = 14
Top = 1830
Width = 1605
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 315
Index = 5
Left = 1350
TabIndex = 13
Top = 1305
Width = 5325
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 315
Index = 4
Left = 1350
TabIndex = 12
Top = 945
Width = 5325
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 315
Index = 3
Left = 4515
TabIndex = 11
Top = 570
Width = 2145
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 315
Index = 2
Left = 1350
TabIndex = 10
Top = 570
Width = 2145
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 315
Index = 1
Left = 4515
TabIndex = 9
Top = 180
Width = 2145
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 315
Index = 0
Left = 1350
TabIndex = 8
Top = 210
Width = 2145
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "税号:"
Height = 180
Index = 5
Left = 3765
TabIndex = 7
Top = 270
Width = 540
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "联系人:"
Height = 180
Index = 4
Left = 3765
TabIndex = 6
Top = 630
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "单位全称:"
Height = 180
Index = 3
Left = 285
TabIndex = 5
Top = 270
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "单位地址:"
Height = 180
Index = 2
Left = 315
TabIndex = 4
Top = 975
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "开户行及账号:"
Height = 180
Index = 1
Left = 105
TabIndex = 3
Top = 1380
Width = 1260
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "单位电话:"
Height = 180
Index = 0
Left = 300
TabIndex = 2
Top = 645
Width = 900
End
End
End
End
Attribute VB_Name = "frm_LocalUnits"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdExit_Click()
Unload Me
frm_main.Enabled = True
End Sub
Private Sub cmdsave_Click()
If Text1(0).Text = "" Then MsgBox "单位全称不能为空": Exit Sub '结束当前过程
'ADO控件的RecordSource执行SQL语句
Adodc1.RecordSource = "select * from tbS_unit"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Delete
End If
Adodc1.Recordset.AddNew
For i = 0 To Text1.Count - 1
Adodc1.Recordset.Fields(i) = Text1(i).Text
Next i
Adodc1.Recordset.Update
MsgBox "更新成功"
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = PublicStr
'ADO控件的RecordSource执行SQL语句
Adodc1.RecordSource = "select * from tbS_unit"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
For i = 0 To Text1.Count - 1
Text1(i).Text = Adodc1.Recordset.Fields(i)
Next i
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True
End Sub
Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
'常数13为键盘上的"回车键"
If KeyCode = 13 Then
SendKeys "{TAB}"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -