📄 景点_导游查询.frm
字号:
VERSION 5.00
Begin VB.Form 景点导游查询
Caption = "景点-->导游查询"
ClientHeight = 5055
ClientLeft = 60
ClientTop = 450
ClientWidth = 6975
LinkTopic = "Form1"
Picture = "景点_导游查询.frx":0000
ScaleHeight = 5055
ScaleWidth = 6975
StartUpPosition = 2 'CenterScreen
Begin VB.TextBox Text6
Height = 375
Left = 1920
TabIndex = 10
Top = 3360
Width = 3015
End
Begin VB.TextBox Text5
Height = 375
Left = 4920
TabIndex = 9
Top = 2880
Width = 615
End
Begin VB.TextBox Text4
Height = 375
Left = 4920
TabIndex = 8
Top = 2400
Width = 615
End
Begin VB.TextBox Text3
Height = 375
Left = 1920
TabIndex = 7
Top = 2880
Width = 1215
End
Begin VB.TextBox Text2
Height = 375
Left = 1920
TabIndex = 6
Top = 2400
Width = 1215
End
Begin VB.ComboBox Combo1
Height = 315
ItemData = "景点_导游查询.frx":11231
Left = 3840
List = "景点_导游查询.frx":1123B
TabIndex = 3
Text = "请选择查询方式"
Top = 480
Width = 1695
End
Begin VB.CommandButton 取消
Caption = "取消"
Height = 375
Left = 5760
TabIndex = 2
Top = 1080
Width = 855
End
Begin VB.CommandButton 查询
Caption = "查询"
Height = 375
Left = 5760
TabIndex = 1
Top = 480
Width = 855
End
Begin VB.TextBox Text1
Height = 375
Left = 3840
TabIndex = 0
Top = 1080
Width = 1695
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "联系方式"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0080FFFF&
Height = 375
Left = 600
TabIndex = 14
Top = 3360
Width = 855
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
Caption = "年龄"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0080FFFF&
Height = 375
Left = 3840
TabIndex = 13
Top = 2880
Width = 975
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "性别"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0080FFFF&
Height = 255
Left = 3840
TabIndex = 12
Top = 2400
Width = 615
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "导游姓名"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0080FFFF&
Height = 375
Left = 600
TabIndex = 11
Top = 2880
Width = 735
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "导游编号"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0080FFFF&
Height = 375
Left = 600
TabIndex = 5
Top = 2400
Width = 975
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "景点->导游查询"
BeginProperty Font
Name = "方正舒体"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0080FFFF&
Height = 495
Left = 480
TabIndex = 4
Top = 720
Width = 2895
End
End
Attribute VB_Name = "景点导游查询"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub 查询_Click()
Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
db.ConnectionString = "driver={SQL Server};server=zhangwei;database=travaldb"
db.Open
If Combo1.Text = "请选择查询方式" Then
MsgBox ("请选择您要查询的方式")
Text1.Text = ""
Else
If Combo1.Text = "景点编号" Then
rs.Open "select * from 导游数据表 where 景点编号='" & Trim(Text1.Text) & "'", db, 3, 3
If rs.EOF Then
MsgBox ("景点未登记")
Combo1.Text = "请选择查询方式"
Text1.Text = ""
rs.Close
Else
Text2.Text = rs("导游编号")
Text3.Text = rs("导游姓名")
Text4.Text = rs("性别")
Text5.Text = rs("年龄")
Text6.Text = rs("联系方式")
rs.Close
End If
Else
rs.Open "select * from 导游数据表,旅游景点数据表 where 景点名称='" & Trim(Text1.Text) & "' and 导游数据表.景点编号 = 旅游景点数据表.景点编号 ", db, 3, 3
If rs.EOF Then
MsgBox ("景点未登记")
Combo1.Text = "请选择查询方式"
Text1.Text = ""
rs.Close
Else
Text2.Text = rs("导游编号")
Text3.Text = rs("导游姓名")
Text4.Text = rs("性别")
Text5.Text = rs("年龄")
Text6.Text = rs("联系方式")
rs.Close
End If
End If
End If
End Sub
Private Sub 取消_Click()
Combo1.Text = "请选择查询方式"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -