📄 frm_lsdtj.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "RICHTX32.OCX"
Begin VB.Form Frm_lsdtj
BorderStyle = 1 'Fixed Single
Caption = "连锁店添加"
ClientHeight = 3840
ClientLeft = 5160
ClientTop = 4575
ClientWidth = 4935
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3840
ScaleWidth = 4935
Begin VB.CommandButton Cmdexit
Caption = "取消"
Height = 375
Left = 3720
TabIndex = 6
Top = 3240
Width = 975
End
Begin VB.CommandButton Cmdadd
Caption = "添加"
Default = -1 'True
Height = 375
Left = 2280
TabIndex = 5
Top = 3240
Width = 975
End
Begin VB.Frame Frame2
Height = 735
Left = 0
TabIndex = 13
Top = 3000
Width = 4815
End
Begin VB.Frame Frame1
Height = 3015
Left = 0
TabIndex = 7
Top = 0
Width = 4815
Begin VB.TextBox Text1
Height = 375
Index = 0
Left = 1440
TabIndex = 0
Top = 120
Width = 3255
End
Begin VB.TextBox Text1
Height = 375
Index = 1
Left = 1440
TabIndex = 1
Top = 600
Width = 3255
End
Begin VB.TextBox Text1
Height = 375
Index = 2
Left = 1440
TabIndex = 2
Top = 1080
Width = 3255
End
Begin VB.TextBox Text1
Height = 375
Index = 3
Left = 1440
TabIndex = 3
Top = 1560
Width = 3255
End
Begin RichTextLib.RichTextBox RichTextBox1
Height = 735
Left = 1440
TabIndex = 4
Top = 2040
Width = 3255
_ExtentX = 5741
_ExtentY = 1296
_Version = 393217
TextRTF = $"Frm_lsdtj.frx":0000
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "电话号码"
Height = 255
Left = 480
TabIndex = 12
Top = 1560
Width = 855
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "连锁店地址"
Height = 255
Left = 360
TabIndex = 11
Top = 1080
Width = 975
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "连锁店名称"
Height = 255
Left = 360
TabIndex = 10
Top = 600
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "连锁店编号"
Height = 255
Left = 360
TabIndex = 9
Top = 240
Width = 1095
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "备注"
Height = 255
Left = 840
TabIndex = 8
Top = 1920
Width = 375
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 3600
Top = 0
Visible = 0 'False
Width = 1455
_ExtentX = 2566
_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 = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=shop"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=shop"
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
End
Attribute VB_Name = "Frm_lsdtj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Activate()
Text1(1).SetFocus
Adodc1.RecordSource = "select * from 连锁店表 order by 连锁店编号"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveLast
Text1(0).Text = Format(Adodc1.Recordset.Fields("连锁店编号") + 1, "000")
Else
Text1(0).Text = "101"
End If
End Sub
Private Sub Cmdadd_Click()
Dim AdoRs As ADODB.Recordset
Dim sql As String
If IsNumeric(Text1(0).Text) = False Then
MsgBox "请输入数字!"
Text1(0).SetFocus
Exit Sub
End If
If Text1(0).Text = "" Or Text1(1).Text = "" Then
MsgBox "重要内容不能为空!"
Text1(0).SetFocus
Exit Sub
End If
If IsNumeric(Text1(3).Text) = False Then
MsgBox "请输入电话号码!"
Text1(3).SetFocus
Exit Sub
End If
sql = "select * from 连锁店表 where 连锁店编号 = '" & Text1(0).Text & "'"
Set AdoRs = cnn.Execute(sql)
If AdoRs.BOF And AdoRs.EOF Then
sql = "insert into 连锁店表 (连锁店编号,连锁店名称,连锁店地址,电话号码,备注) "
sql = sql & "values ('" & Text1(0).Text & "','" & Text1(1).Text & "','" & Text1(2).Text & "','" & Text1(3).Text & "','" & RichTextBox1.Text & "')"
cnn.Execute (sql)
'MsgBox "数据保存成功!"
End If
Adodc1.RecordSource = "select * from 连锁店表 order by 连锁店编号"
Adodc1.Refresh
Frm_lsdlb.Adodc1.Refresh
Unload Me
End Sub
Private Sub Cmdexit_Click()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -