📄 findvip.frm
字号:
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.Label Label1
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "请输入你要查询的数据:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 360
TabIndex = 10
Top = 6000
Width = 2415
End
Begin VB.Label Label2
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
Caption = "日期格式:YYYY-MM-DD"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 255
Left = 6480
TabIndex = 9
Top = 6000
Visible = 0 'False
Width = 2295
End
End
End
Attribute VB_Name = "FindVip"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Download by http://www.codefans.net
Option Explicit
Private Sub Command1_Click()
Dim SQL As String
If Text1.Text = "" Then
MsgBox "请你输入你要查询的数据关键字!", vbInformation + vbOKOnly, "信息"
Text1.SetFocus
Exit Sub
End If
If Check1.Value = 0 Then
If Option1.Value = True Then
SQL = "select * from vipinfo where 会员ID='" & Text1.Text & "'"
End If
If Option2.Value = True Then
SQL = "select * from vipinfo where 会员姓名='" & Text1.Text & "'"
End If
If Option3.Value = True Then
SQL = "select * from vipinfo where 会员级别='" & Text1.Text & "'"
End If
If Option4.Value = True Then
SQL = "select * from vipinfo where 办理日期=#" & Text1.Text & "#"
End If
ElseIf Check1.Value = 1 Then
If Option1.Value = True Then
SQL = "select * from vipinfo where 会员ID like '%" & Text1.Text & "%'"
End If
If Option2.Value = True Then
SQL = "select * from vipinfo where 会员姓名 like '%" & Text1.Text & "%'"
End If
If Option3.Value = True Then
SQL = "select * from vipinfo where 会员级别 like '%" & Text1.Text & "%'"
End If
If Option4.Value = True Then
SQL = "select * from vipinfo where 办理日期 like '%" & Text1.Text & "%'"
End If
End If
Adodc1.RecordSource = SQL
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
If Adodc1.Recordset.RecordCount <= 0 Then
MsgBox "数据库中暂没有你需要的信息!", vbInformation + vbOKOnly, "信息"
Text1.Text = ""
Text1.SetFocus
Command3.Enabled = False
Command4.Enabled = False
Command6.Visible = False
Else
Command3.Enabled = True
Command4.Enabled = True
Command6.Visible = True
End If
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text1.SetFocus
Option1.Value = True
Option2.Value = False
Option3.Value = False
Option4.Value = False
Option5.Value = False
Check1.Value = 0
End Sub
Private Sub Command3_Click()
If Adodc1.Recordset.RecordCount <= 0 Then
MsgBox "暂没有影碟信息可供你修改!", vbInformation + vbOKOnly, "信息"
Exit Sub
End If
EditVip.Show vbModal
End Sub
Private Sub Command4_Click()
If Adodc1.Recordset.RecordCount <= 0 Then
MsgBox "暂没有影碟信息可供你删除!", vbInformation + vbOKOnly, "警告"
Exit Sub
End If
If MDIForm1.MdSet.Visible = False Then
MsgBox "你不是管理员用户,你无法删除影碟信息!", vbInformation + vbOKOnly, "警告"
Exit Sub
End If
DataGrid1.Col = 0
If MsgBox("你确实删除会员ID为“" & DataGrid1.Text & "”的会员信息?", vbInformation + vbYesNo, "是否删除") = vbYes Then
With Adodc1.Recordset
.Delete
End With
MsgBox "会员信息删除成功,按取消按钮返回!", vbInformation + vbOKOnly, "提示"
End If
End Sub
Private Sub Command5_Click()
Unload Me
End Sub
Private Sub Command6_Click()
FindVipinfo.Show vbModal
End Sub
Private Sub Form_Load()
Adodc1.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" _
& App.Path & "\cdlent.mdb;Mode=ReadWrite;Persist Security Info=True;Jet OLEDB:Database Password=123456"
Adodc1.CursorLocation = adUseClient
Adodc1.CommandType = adCmdText
Command3.Enabled = False
Command4.Enabled = False
Label2.Visible = False
SkyGzForm1.Caption = Me.Caption
SkyGzForm1.hWnd = Me.hWnd
End Sub
Private Sub Option1_Click()
Label1.Caption = "按编号查询"
Text1.SetFocus
Label2.Visible = False
End Sub
Private Sub Option2_Click()
Label1.Caption = "按姓名查询"
Text1.SetFocus
Label2.Visible = False
End Sub
Private Sub Option3_Click()
Label1.Caption = "按级别查询"
Text1.SetFocus
Label2.Visible = False
End Sub
Private Sub Option4_Click()
Label1.Caption = "按时间查询"
Text1.SetFocus
Label2.Visible = True
End Sub
Private Sub Option5_Click()
Dim SQL As String
Label2.Visible = False
SQL = "select * from vipinfo"
Adodc1.RecordSource = SQL
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Command3.Enabled = True
Command4.Enabled = True
Command6.Visible = True
Else
Command3.Enabled = False
Command4.Enabled = False
Command6.Visible = False
End If
End Sub
Private Sub text1_keypress(keyascii As Integer)
If keyascii = "13" And Text1.Text <> "" Then
Dim SQL As String
If Check1.Value = 0 Then
If Option1.Value = True Then
SQL = "select * from vipinfo where 会员ID='" & Text1.Text & "'"
End If
If Option2.Value = True Then
SQL = "select * from vipinfo where 会员姓名='" & Text1.Text & "'"
End If
If Option3.Value = True Then
SQL = "select * from vipinfo where 会员级别='" & Text1.Text & "'"
End If
If Option4.Value = True Then
SQL = "select * from vipinfo where 办理日期=#" & Text1.Text & "#"
End If
ElseIf Check1.Value = 1 Then
If Option1.Value = True Then
SQL = "select * from vipinfo where 会员ID like '%" & Text1.Text & "%'"
End If
If Option2.Value = True Then
SQL = "select * from vipinfo where 会员姓名 like '%" & Text1.Text & "%'"
End If
If Option3.Value = True Then
SQL = "select * from vipinfo where 会员级别 like '%" & Text1.Text & "%'"
End If
If Option4.Value = True Then
SQL = "select * from vipinfo where 办理日期 like '%" & Text1.Text & "%'"
End If
End If
Adodc1.RecordSource = SQL
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
If Adodc1.Recordset.RecordCount <= 0 Then
MsgBox "数据库中暂没有你需要的信息!", vbInformation + vbOKOnly, "信息"
Text1.Text = ""
Text1.SetFocus
Command3.Enabled = False
Command4.Enabled = False
Command6.Visible = False
Else
Command3.Enabled = True
Command4.Enabled = True
Command6.Visible = True
End If
ElseIf keyascii = "13" And Text1.Text = "" Then
MsgBox "请你输入你需要查询数据的关键字!", vbInformation + vbOKOnly, "信息"
Text1.SetFocus
End If
End Sub
Private Sub Form_Resize()
SkyGzForm1.Left = 0
SkyGzForm1.Top = 0
Me.Width = SkyGzForm1.Width - 5
Me.Height = SkyGzForm1.Height
Call SkyGzForm1.SetRgn(Me, 5)
End Sub
Private Sub SkyGzForm1_UnloadClick()
Unload Me
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -