www.pudn.com > 数据库作业.rar > jbrxx.frm
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form jbrxx
BorderStyle = 1 'Fixed Single
Caption = "经办人信息"
ClientHeight = 4335
ClientLeft = 7380
ClientTop = 2595
ClientWidth = 6045
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4335
ScaleWidth = 6045
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame2
Height = 1575
Left = 120
TabIndex = 19
Top = 2640
Width = 5775
Begin VB.CommandButton Comcancel
Caption = "取消"
Height = 495
Left = 4440
TabIndex = 12
Top = 960
Width = 1215
End
Begin VB.CommandButton Comfirst
Caption = "第一页"
Height = 495
Left = 120
TabIndex = 2
Top = 240
Width = 1215
End
Begin VB.CommandButton Compre
Caption = "上一页"
Height = 495
Left = 1560
TabIndex = 3
Top = 240
Width = 1215
End
Begin VB.CommandButton Comnext
Caption = "下一页"
Height = 495
Left = 3000
TabIndex = 4
Top = 240
Width = 1215
End
Begin VB.CommandButton Comlast
Caption = "最后一页"
Height = 495
Left = 4440
TabIndex = 5
Top = 240
Width = 1215
End
Begin VB.CommandButton Comsave
Caption = "保存"
Height = 495
Left = 3000
TabIndex = 1
Top = 960
Width = 1215
End
Begin VB.CommandButton Comadd
Caption = "添加"
Height = 495
Left = 120
TabIndex = 6
Top = 960
Width = 1215
End
Begin VB.CommandButton Comdel
Caption = "删除"
Height = 495
Left = 1560
TabIndex = 7
Top = 960
Width = 1215
End
End
Begin VB.Frame Frame1
Caption = "经办人信息"
Height = 2415
Left = 120
TabIndex = 0
Top = 120
Width = 5775
Begin VB.ComboBox Combo1
DataField = "性别"
DataSource = "Adodc1"
Height = 300
ItemData = "jbrxx.frx":0000
Left = 960
List = "jbrxx.frx":000A
Style = 2 'Dropdown List
TabIndex = 9
Top = 1080
Width = 735
End
Begin VB.TextBox Text5
DataField = "备注"
DataSource = "Adodc1"
Height = 495
Left = 960
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 11
Text = "jbrxx.frx":0016
Top = 1800
Width = 1935
End
Begin VB.TextBox Text4
DataField = "电话"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 960
TabIndex = 10
Text = "Text4"
Top = 1440
Width = 1335
End
Begin VB.TextBox Text2
DataField = "姓名"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 960
TabIndex = 8
Text = "Text2"
Top = 720
Width = 975
End
Begin VB.TextBox Text1
BackColor = &H8000000B&
DataField = "编号"
DataSource = "Adodc1"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 960
Locked = -1 'True
TabIndex = 13
Text = "Text1"
Top = 360
Width = 1215
End
Begin VB.Label Label10
Caption = "备注"
Height = 255
Left = 120
TabIndex = 18
Top = 1800
Width = 495
End
Begin VB.Label Label6
Caption = "电话"
Height = 255
Left = 120
TabIndex = 17
Top = 1440
Width = 495
End
Begin VB.Label Label3
Caption = "性别"
Height = 255
Left = 120
TabIndex = 16
Top = 1080
Width = 495
End
Begin VB.Label Label2
Caption = "姓名"
Height = 255
Left = 120
TabIndex = 15
Top = 720
Width = 495
End
Begin VB.Label Label1
Caption = "编号"
Height = 255
Left = 120
TabIndex = 14
Top = 360
Width = 495
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 120
Top = 4080
Visible = 0 'False
Width = 1575
_ExtentX = 2778
_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=Microsoft.Jet.OLEDB.4.0;Data Source=医药信息管理系统.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=医药信息管理系统.mdb;Persist Security Info=False"
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 = "jbrxx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim b As Integer
Dim c As Integer
Private Sub Comadd_Click()
Comdel.Enabled = False
Comfirst.Enabled = False
Comnext.Enabled = False
Comlast.Enabled = False
Compre.Enabled = False
Comadd.Enabled = False
Comcancel.Enabled = True
b = Adodc1.Recordset.AbsolutePosition
c = Adodc1.Recordset.RecordCount + 1
Adodc1.Recordset.MoveLast
a = Adodc1.Recordset("编号")
Adodc1.Recordset.AddNew
Adodc1.Recordset("编号") = a + 1
Adodc1.Recordset("性别") = "男"
Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页 共" & Adodc1.Recordset.RecordCount & "页"
End Sub
Private Sub Comdel_Click()
Y = MsgBox("要删除该记录吗?", 36, "删除记录")
If Y = vbYes Then
If Adodc1.Recordset.AbsolutePosition < Adodc1.Recordset.RecordCount Then
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
Else
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveLast
End If
End If
If Adodc1.Recordset.RecordCount = 1 Then
Comdel.Enabled = False
End If
Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页 共" & Adodc1.Recordset.RecordCount & "页"
End Sub
Private Sub Comfirst_Click()
Adodc1.Recordset.MoveFirst
Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页 共" & Adodc1.Recordset.RecordCount & "页"
End Sub
Private Sub Compre_Click()
If Adodc1.Recordset.AbsolutePosition > 1 Then
Adodc1.Recordset.MovePrevious
Else
Adodc1.Recordset.MoveFirst
End If
Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页 共" & Adodc1.Recordset.RecordCount & "页"
End Sub
Private Sub Comnext_Click()
If Adodc1.Recordset.AbsolutePosition < Adodc1.Recordset.RecordCount Then
Adodc1.Recordset.MoveNext
Else
Adodc1.Recordset.MoveLast
End If
Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页 共" & Adodc1.Recordset.RecordCount & "页"
End Sub
Private Sub Comlast_Click()
Adodc1.Recordset.MoveLast
Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页 共" & Adodc1.Recordset.RecordCount & "页"
End Sub
Private Sub Comcancel_Click()
Adodc1.Recordset.Delete
Adodc1.Recordset.Move (b - c)
Comdel.Enabled = True
Comfirst.Enabled = True
Comnext.Enabled = True
Comlast.Enabled = True
Compre.Enabled = True
Comadd.Enabled = True
Comcancel.Enabled = False
Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页 共" & Adodc1.Recordset.RecordCount & "页"
End Sub
Private Sub Comsave_Click()
If Text2.Text = "" Then
MsgBox ("请输入姓名!"), 16, ("错误")
ElseIf Combo1.Text = "" Then
MsgBox ("请选择性别!"), 16, ("错误")
ElseIf Text4.Text = "" Then
MsgBox ("请输入电话!"), 16, ("错误")
Else
Adodc1.Recordset.UpdateBatch
Comdel.Enabled = True
Comfirst.Enabled = True
Comnext.Enabled = True
Comlast.Enabled = True
Compre.Enabled = True
Comadd.Enabled = True
Comcancel.Enabled = False
End If
Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页 共" & Adodc1.Recordset.RecordCount & "页"
End Sub
Private Sub Form_Load()
On Error Resume Next
Comcancel.Enabled = False
If csxx.d = 1 Then
Adodc1.Recordset.Find "编号 = '" & csxx.Adodc1.Recordset("编号") & "'"
End If
Frame2.Caption = "第" & Adodc1.Recordset.AbsolutePosition & "页 共" & Adodc1.Recordset.RecordCount & "页"
End Sub