?? findreader.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 findreader
BorderStyle = 1 'Fixed Single
Caption = "讀者查詢修改"
ClientHeight = 6705
ClientLeft = 4380
ClientTop = 2580
ClientWidth = 7800
Icon = "findreader.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 6705
ScaleWidth = 7800
Begin VB.Frame Frame4
Caption = "編輯"
Height = 735
Left = 120
TabIndex = 13
Top = 1800
Width = 7575
Begin VB.CommandButton Command5
Caption = "刪除"
Enabled = 0 'False
Height = 375
Left = 4560
TabIndex = 15
Top = 240
Width = 1455
End
Begin VB.CommandButton Command4
Caption = "修改"
Enabled = 0 'False
Height = 375
Left = 1440
TabIndex = 14
Top = 240
Width = 1455
End
End
Begin VB.Frame Frame3
Caption = "查詢結果"
Height = 3975
Left = 120
TabIndex = 10
Top = 2640
Width = 7575
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "findreader.frx":2C14A
Height = 3615
Left = 120
TabIndex = 11
Top = 240
Width = 7335
_ExtentX = 12938
_ExtentY = 6376
_Version = 393216
AllowUpdate = 0 'False
BackColor = 12648447
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
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 MSAdodcLib.Adodc Adodc1
Height = 495
Left = 1320
Top = 1920
Visible = 0 'False
Width = 2535
_ExtentX = 4471
_ExtentY = 873
ConnectMode = 0
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= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
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
Begin VB.Frame Frame2
Caption = "查詢"
Height = 1695
Left = 3960
TabIndex = 5
Top = 120
Width = 3735
Begin VB.CommandButton Command7
Caption = "關閉"
Height = 375
Left = 2400
TabIndex = 12
Top = 1200
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "清空"
Height = 375
Left = 1320
TabIndex = 9
Top = 1200
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "查詢"
Height = 375
Left = 240
TabIndex = 8
Top = 1200
Width = 1095
End
Begin VB.TextBox Text1
BackColor = &H00C0FFFF&
Height = 375
Left = 1680
TabIndex = 7
Top = 360
Width = 1815
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
Caption = "請選擇查詢方式"
Height = 375
Left = 120
TabIndex = 6
Top = 480
Width = 1455
End
End
Begin VB.Frame Frame1
Caption = "查詢方式"
Height = 1695
Left = 120
TabIndex = 0
Top = 120
Width = 3735
Begin VB.OptionButton Option5
Caption = "查看所有讀者信息"
Height = 255
Left = 360
TabIndex = 16
Top = 1200
Width = 2175
End
Begin VB.OptionButton Option4
Caption = "按辦證日期查詢"
Height = 375
Left = 1920
TabIndex = 4
Top = 720
Width = 1575
End
Begin VB.OptionButton Option3
Caption = "按單位查詢"
Height = 375
Left = 360
TabIndex = 3
Top = 720
Width = 1335
End
Begin VB.OptionButton Option2
Caption = "按姓名查詢"
Height = 375
Left = 1920
TabIndex = 2
Top = 240
Width = 1575
End
Begin VB.OptionButton Option1
Caption = "按編號查詢"
Height = 375
Left = 360
TabIndex = 1
Top = 240
Width = 1455
End
End
End
Attribute VB_Name = "findreader"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Command1_Click()
Dim x As String
If Text1.Text = "" Then
MsgBox "請輸入查詢內容", vbInformation + vbOKOnly, "警告"
Text1.SetFocus
Exit Sub
End If
If Option1.Value = False And Option2.Value = False And Option3.Value = False And Option4.Value = False Then
MsgBox "請選擇查詢方式", vbInformation + vbOKOnly, "警告"
Option1.Value = True
Exit Sub
End If
If Option1.Value = True Then
x = "select * from readerinfo where 讀者編號 in(" + "'" + Text1.Text + "')"
End If
If Option2.Value = True Then
x = "select * from readerinfo where 讀者姓名 in(" + "'" + Text1.Text + "')"
End If
If Option3.Value = True Then
x = "select * from readerinfo where 所屬單位 in(" + "'" + Text1.Text + "')"
End If
If Option4.Value = True Then
x = "select * from readerinfo where 辦證日期 in(#" & Text1.Text & "#)"
End If
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = x
Adodc1.Refresh
If Adodc1.Recordset.RecordCount <= 0 Then
MsgBox "對不起沒有你所需要的讀者信息!", vbInformation + vbOKOnly, "信息"
Text1.Text = ""
Text1.SetFocus
Command4.Enabled = False
Command5.Enabled = False
Exit Sub
Else
Command4.Enabled = True
Command5.Enabled = True
End If
End Sub
Private Sub Command2_Click()
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
Option5.Value = False
Text1.Text = ""
End Sub
Private Sub Command4_Click()
If MDIForm1.mfadd.Enabled = False Then
MsgBox "對不起,你的權限不夠,不能進行修改操作!", vbInformation + vbOKOnly, "信息"
Exit Sub
Else
editreader.Show
End If
End Sub
Private Sub Command5_Click()
Dim strReadID As String
If MDIForm1.mfadd.Enabled = False Then
MsgBox "對不起,你的權限不夠,不能進行刪除操作!", vbInformation + vbOKOnly, "信息"
Exit Sub
Else
DataGrid1.Col = 0
strReadID = DataGrid1.Text
If strReadID <> "" Then
Set g_rs = g_db.OpenRecordset("select * from lentinfo ")
Do While Not g_rs.EOF
If g_rs!讀者編號 = strReadID Then
MsgBox "對不起,該讀者尚有圖書未還,不能刪除!", vbInformation + vbOKOnly, "警告"
Set g_rs = Nothing
Exit Sub
End If
g_rs.MoveNext
Loop
If MsgBox("是否確定要刪除讀者編號為" + strReadID + "的信息?", vbInformation + vbOKCancel, "刪除") = vbOK Then
With Adodc1.Recordset
.Delete
If .EOF Then
.MoveLast
Else
.MoveNext
End If
End With
MsgBox "編號為" + strReadID + "的信息已經刪除!", vbInformation + vbOKOnly, "信息"
Exit Sub
End If
Else
Exit Sub
End If
End If
End Sub
Private Sub Command7_Click()
Unload Me
End Sub
Private Sub Form_Load()
dbl
Option1.Value = False
Option2.Value = False
Option3.Value = False
Option4.Value = False
Option5.Value = False
Adodc1.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" _
& App.Path & "\db2.mdb;Mode=ReadWrite;persist security info=true;Jet OLEDB:Database Password=xgg2213"
Adodc1.CursorLocation = adUseClient
End Sub
Private Sub Option1_Click()
Label1.Caption = "按編號查詢"
End Sub
Private Sub Option2_Click()
Label1.Caption = "按姓名查詢"
End Sub
Private Sub Option3_Click()
Label1.Caption = "按單位查詢"
End Sub
Private Sub Option4_Click()
Label1.Caption = "按辦證日期查詢"
End Sub
Private Sub Option5_Click()
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from readerinfo"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount <= 0 Then
Exit Sub
Else
Command4.Enabled = True
Command5.Enabled = True
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -