📄 customer_information.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 Customer_information
Caption = "客户信息"
ClientHeight = 6840
ClientLeft = 60
ClientTop = 465
ClientWidth = 8805
Icon = "Customer_information.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 6840
ScaleWidth = 8805
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 3600
Top = 3360
Width = 2055
_ExtentX = 3625
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=CARS"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "CARS"
OtherAttributes = ""
UserName = "bai"
Password = "052606241"
RecordSource = "客户信息表"
Caption = "客户浏览"
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 DataGrid1
Bindings = "Customer_information.frx":319A
Height = 2775
Left = 120
TabIndex = 19
Top = 3960
Width = 8655
_ExtentX = 15266
_ExtentY = 4895
_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.CommandButton Command4
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 7440
TabIndex = 18
Top = 3240
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "登记"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 480
TabIndex = 17
Top = 3240
Width = 1095
End
Begin VB.Frame Frame1
Caption = "客户基本信息"
Height = 2895
Left = 120
TabIndex = 2
Top = 120
Width = 8535
Begin VB.TextBox Text7
Height = 375
Left = 5640
TabIndex = 16
Top = 2280
Width = 1695
End
Begin VB.TextBox Text6
Height = 375
Left = 1200
TabIndex = 15
Top = 2160
Width = 1455
End
Begin VB.TextBox Text5
Height = 375
Left = 5400
TabIndex = 14
Top = 1680
Width = 2895
End
Begin VB.TextBox Text4
Height = 375
Left = 1440
TabIndex = 13
Top = 1560
Width = 2175
End
Begin VB.TextBox Text3
Height = 375
Left = 1080
TabIndex = 12
Top = 960
Width = 4815
End
Begin VB.TextBox Text2
Height = 375
Left = 5880
TabIndex = 11
Top = 360
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Left = 1320
TabIndex = 10
Top = 360
Width = 2655
End
Begin VB.Label Label8
Caption = "*"
ForeColor = &H000000FF&
Height = 135
Left = 4080
TabIndex = 20
Top = 480
Width = 255
End
Begin VB.Label Label2
Caption = "电话"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 5160
TabIndex = 9
Top = 360
Width = 495
End
Begin VB.Label Label5
Caption = "银行帐号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4320
TabIndex = 8
Top = 1680
Width = 975
End
Begin VB.Label Label4
Caption = "开户银行"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 7
Top = 1560
Width = 1095
End
Begin VB.Label Label6
Caption = "联系人"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 6
Top = 2160
Width = 735
End
Begin VB.Label Label3
Caption = "地址"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 5
Top = 960
Width = 495
End
Begin VB.Label Label7
Caption = "联系人电话"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4320
TabIndex = 4
Top = 2280
Width = 1095
End
Begin VB.Label Label1
Caption = "客户名称"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 3
Top = 360
Width = 975
End
End
Begin VB.CommandButton Command3
BackColor = &H80000010&
Caption = "删除"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6120
TabIndex = 1
Top = 3240
Width = 975
End
Begin VB.CommandButton Command2
BackColor = &H80000010&
Caption = "保存"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2040
TabIndex = 0
Top = 3240
Width = 975
End
Begin VB.Line Line2
X1 = 0
X2 = 8760
Y1 = 3840
Y2 = 3840
End
Begin VB.Line Line1
X1 = 0
X2 = 8760
Y1 = 3120
Y2 = 3120
End
End
Attribute VB_Name = "Customer_information"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public adoCon As New ADODB.Connection
Public rs As New ADODB.Recordset
Public Sub main()
Set adoCon = New ADODB.Connection
adoCon.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=bai;password=052606241;Initial Catalog=CARS;Data Source=5c92669bd5be43c"
End Sub
Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub
Private Sub Command2_Click()
Call main
If Text1.Text = "" Then
MsgBox "客户名称不能为空!", 64, "提示信息"
Text1.SetFocus: Exit Sub
End If
rs.Open "select * from 客户信息表", adoCon, adOpenKeyset, adLockOptimistic
rs.AddNew
rs.Fields("客户名称") = Text1.Text
rs.Fields("电话") = Val(Text2.Text)
rs.Fields("地址") = Text3.Text
rs.Fields("开户银行") = Text4.Text
rs.Fields("银行帐号") = Val(Text5.Text)
rs.Fields("联系人") = Text6.Text
rs.Fields("联系人电话") = Val(Text7.Text)
rs.Update
MsgBox "客户信息保存成功!", 0, "提示信息"
Adodc1.Refresh
rs.Close
End Sub
Private Sub Command3_Click()
If Adodc1.Recordset.EOF = False Then
c = MsgBox("您确认删除该记录么?", 17, "提示信息")
If c = vbOK Then
Adodc1.Recordset.Delete
Adodc1.Refresh
MsgBox "该记录已成功删除!", 0, "提示信息"
Else
End If
Else
MsgBox "当前数据中已经没有可删除的记录", 17, "提示信息"
End If
End Sub
Private Sub Command4_Click()
Unload Customer_information
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -