📄 main_jcxx_dzxxsz.frm
字号:
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=Nbooks"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "Nbooks"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from reads"
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
Begin VB.Frame Frame3
Caption = "请选择查询条件"
Height = 660
Left = 60
TabIndex = 7
Top = 45
Width = 8355
Begin VB.CommandButton CmdPrint
Caption = "打印"
Height = 330
Left = 6765
TabIndex = 41
Top = 210
Width = 1485
End
Begin VB.TextBox Text7
Height = 300
Left = 1185
TabIndex = 10
Top = 225
Width = 3945
End
Begin VB.CommandButton CmdFind
Caption = "查询"
Height = 330
Left = 5205
TabIndex = 9
Top = 210
Width = 1485
End
Begin VB.ComboBox Combo3
Height = 300
ItemData = "main_jcxx_dzxxsz.frx":0D23
Left = 105
List = "main_jcxx_dzxxsz.frx":0D25
TabIndex = 8
Top = 225
Width = 1095
End
End
Begin VB.Frame Frame2
Height = 645
Left = 75
TabIndex = 11
Top = 4170
Width = 3105
Begin VB.CommandButton CmdMD
BackColor = &H00FFC0C0&
Caption = "首记录"
Height = 360
Index = 0
Left = 90
Style = 1 'Graphical
TabIndex = 15
Top = 180
Width = 720
End
Begin VB.CommandButton CmdMD
BackColor = &H00FFC0C0&
Caption = "上一条"
Height = 360
Index = 1
Left = 810
Style = 1 'Graphical
TabIndex = 14
Top = 180
Width = 720
End
Begin VB.CommandButton CmdMD
BackColor = &H00FFC0C0&
Caption = "下一条"
Height = 360
Index = 2
Left = 1530
Style = 1 'Graphical
TabIndex = 13
Top = 180
Width = 720
End
Begin VB.CommandButton CmdMD
BackColor = &H00FFC0C0&
Caption = "末记录"
Height = 360
Index = 3
Left = 2250
Style = 1 'Graphical
TabIndex = 12
Top = 180
Width = 720
End
End
Begin VB.Frame Frame4
Height = 645
Left = 3150
TabIndex = 20
Top = 4170
Width = 5340
Begin VB.CommandButton CmdSave
BackColor = &H8000000B&
Caption = "保存"
Enabled = 0 'False
Height = 360
Left = 2655
Style = 1 'Graphical
TabIndex = 26
Top = 180
Width = 855
End
Begin VB.CommandButton CmdAdd
BackColor = &H8000000B&
Caption = "添加"
Height = 360
Left = 90
Style = 1 'Graphical
TabIndex = 25
Top = 180
Width = 855
End
Begin VB.CommandButton CmdDelete
BackColor = &H8000000B&
Caption = "删除"
Height = 360
Left = 1800
Style = 1 'Graphical
TabIndex = 24
Top = 180
Width = 855
End
Begin VB.CommandButton CmdEsc
BackColor = &H8000000B&
Caption = "取消"
Height = 360
Left = 3510
Style = 1 'Graphical
TabIndex = 23
Top = 180
Width = 855
End
Begin VB.CommandButton CmdExit
BackColor = &H8000000B&
Caption = "退出"
Height = 360
Left = 4365
Style = 1 'Graphical
TabIndex = 22
Top = 180
Width = 855
End
Begin VB.CommandButton CmdModify
BackColor = &H8000000B&
Caption = "修改"
Height = 360
Left = 945
Style = 1 'Graphical
TabIndex = 21
Top = 180
Width = 855
End
End
End
Attribute VB_Name = "main_jcxx_dzxxsz"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i, a, Mat As Integer '声明整型变量
Dim rs1 As New ADODB.Recordset '声明数据集对象
Dim mst As New ADODB.Stream
Dim con As New ADODB.Connection
Private Sub view_data() '声明一个显示reads表中数据的过程
With Adodc1.Recordset
If .RecordCount > 0 Then
If .EOF Then .MoveLast
If .BOF Then .MoveFirst
'将reads数据表中各字段的值赋给对应的控件
If .Fields("书证号") <> "" Then Text1.text = .Fields("书证号")
If .Fields("姓名") <> "" Then Text2.text = .Fields("姓名")
If .Fields("性别") <> "" Then Combo1.text = .Fields("性别")
If .Fields("身份证") <> "" Then Text3.text = .Fields("身份证")
If .Fields("单位") <> "" Then Text4.text = .Fields("单位")
If .Fields("家庭住址") <> "" Then Text5.text = .Fields("家庭住址") Else Text5.text = ""
If .Fields("联系电话") <> "" Then Text6.text = .Fields("联系电话") Else Text6.text = ""
If .Fields("读者类别") <> "" Then Combo2.text = .Fields("读者类别")
If .Fields("收费标准") <> "" Then Label3.Caption = .Fields("收费标准")
If .Fields("期限") <> "" Then Combo4.text = .Fields("期限")
If .Fields("办证价格") <> "" Then Label4.Caption = .Fields("办证价格")
If .Fields("办证日期") <> "" Then DTPicker1.Value = .Fields("办证日期")
If .Fields("到期日期") <> "" Then DTPicker2.Value = .Fields("到期日期")
If .Fields("已借书数") <> "" Then jss.Caption = .Fields("已借书数")
'显示数据库中的相片
Set Picture1.DataSource = Adodc1
Picture1.DataField = "相片路径"
Image1.Picture = Picture1.Picture
If .Fields("相片路径") Is Nothing Then
Picture1.Picture = LoadPicture()
MsgBox "此读者相片错误,请更改!"
Picture1.Picture = LoadPicture("")
End If
Else
Image1.Picture = LoadPicture()
Text2.text = ""
Text3.text = ""
Text4.text = ""
Text5.text = ""
Text6.text = ""
Label3.Caption = ""
Label4.Caption = ""
Picture1.Picture = LoadPicture("")
Label6.Caption = ""
Combo2.text = ""
Combo4.text = ""
jss.Caption = "0"
SSTab1.Tab = 0
End If
End With
End Sub
Private Sub Ena() '声明一个设置控件有效或无效的过程
If a = 0 Or a = 1 Then '当变量a=0或a=1时
'设置如下控件有效或无效
Text1.Enabled = True
If a <> 1 Then
Image1.Picture = LoadPicture()
Picture1.Picture = LoadPicture()
End If
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Combo1.Enabled = True
Combo2.Enabled = True
Combo4.Enabled = True
DTPicker1.Enabled = True
DTPicker2.Enabled = True
Command1.Enabled = True
CmdSave.Enabled = True
CmdEsc.Enabled = True
CmdAdd.Enabled = False
CmdModify.Enabled = False
CmdDelete.Enabled = False
For i = 0 To 3
CmdMD(i).Enabled = False
Next i
End If
If a = 2 Or a = 3 Then '当变量a=2或a=3时
'设置如下控件有效或无效
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
Combo1.Enabled = False
Combo2.Enabled = False
Combo4.Enabled = False
DTPicker1.Enabled = False
DTPicker2.Enabled = False
Command1.Enabled = False
CmdSave.Enabled = False
CmdEsc.Enabled = False
CmdAdd.Enabled = True
CmdModify.Enabled = True
CmdDelete.Enabled = True
For i = 0 To 3
CmdMD(i).Enabled = True
Next i
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -