【VB开源代码栏目提醒】:网学会员VB开源代码为您提供provider.frm参考,解决您在provider.frm学习中工作中的难题,参考学习。
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form provider
Caption = "供应商管理"
ClientHeight = 5775
ClientLeft = 60
ClientTop = 345
ClientWidth = 6525
LinkTopic = "Form1"
ScaleHeight = 5775
ScaleWidth = 6525
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 1800
Top = 4320
Width = 2400
_ExtentX = 4233
_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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = $"provider.frx":0000
OLEDBString = $"provider.frx":0092
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Pass
word = ""
RecordSource = "info_provider"
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 VB.CommandButton Command4
Caption = "删除"
Height = 495
Left = 4680
TabIndex = 13
Top = 4920
Width = 975
End
Begin VB.CommandButton Command3
Caption = "修改"
Height = 495
Left = 2040
TabIndex = 12
Top = 4920
Width = 975
End
Begin VB.CommandButton Command2
Caption = "保存"
Height = 495
Left = 3360
TabIndex = 11
Top = 4920
Width = 975
End
Begin VB.CommandButton Command1
Caption = "增加"
Height = 495
Left = 720
TabIndex = 10
Top = 4920
Width = 975
End
Begin VB.TextBox Text5
DataField = "ptype"
DataSource = "Adodc1"
Enabled = 0 'False
Height = 1095
Left = 2160
MultiLine = -1 'True
TabIndex = 9
Top = 3000
Width = 2655
End
Begin VB.TextBox Text4
DataField = "pphone"
DataSource = "Adodc1"
Enabled = 0 'False
Height = 375
Left = 2160
TabIndex = 7
Top = 2400
Width = 1935
End
Begin VB.TextBox Text3
DataField = "pmanger"
DataSource = "Adodc1"
Enabled = 0 'False
Height = 375
Left = 2160
TabIndex = 5
Top = 1800
Width = 1935
End
Begin VB.TextBox Text2
DataField = "pname"
DataSource = "Adodc1"
Enabled = 0 'False
Height = 375
Left = 2160
TabIndex = 3
Top = 1200
Width = 2655
End
Begin
VB.TextBox Text1
DataField = "pno"
DataSource = "Adodc1"
Enabled = 0 'False
Height = 375
Left = 2160
TabIndex = 1
Top = 600
Width = 1935
End
Begin VB.Label Label5
Caption = "经营业务:"
Height = 255
Left = 840
TabIndex = 8
Top = 3000
Width = 1215
End
Begin VB.Label Label4
Caption = "电话:"
Height = 255
Left = 840
TabIndex = 6
Top = 2400
Width = 1215
End
Begin VB.Label Label3
Caption = "负责人:"
Height = 255
Left = 840
TabIndex = 4
Top = 1800
Width = 1215
End
Begin VB.Label Label2
Caption = "公司名称:"
Height = 255
Left = 840
TabIndex = 2
Top = 1200
Width = 1215
End
Begin VB.Label Label1
Caption = "供应商编号:"
Height = 255
Left = 840
TabIndex = 0
Top = 600
Width = 1215
End
End
Attribute VB_Name = "provider"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim flag As Integer
Private Sub Command1_Click()
flag = 0
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text1.SetFocus
End Sub
Private Sub Command2_Click()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
If Text1.Text = "" Then
MsgBox "请填写完整的供应商信息"
Else
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\file.mdb;Persist Security Info=False"
If flag = 0 Then
sql = "select * from info_provider"
rs.Open sql, cn, 3, 2
rs.AddNew
rs("pno") = Trim(Text1.Text)
rs("pname") = Trim(Text2.Text)
rs("pmanger") = Trim(Text3.Text)
rs("pphone") = Trim(Text4.Text)
rs("ptype") = Trim(Text5.Text)
rs.Update
Else
sql = "select * from info_provider where pno='" & Text1.Text & "'"
rs.Open
sql, cn, 3, 2
rs("pname") = Trim(Text2.Text)
rs("pmanger") = Trim(Text3.Text)
rs("pphone") = Trim(Text4.Text)
rs("ptype") = Trim(Text5.Text)
rs.Update
End If
MsgBox "保存成功"
End If
End Sub
Private Sub Command3_Click()
flag = 1
Text1.Enabled = False
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text2.SetFocus
End Sub
Private Sub Command4_Click()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\file.mdb;Persist Secu