⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmstdsearch.vb

📁 Online Telephone Directory in Visual Basic
💻 VB
字号:
Option Strict Off
Option Explicit On
Friend Class Form5
	Inherits System.Windows.Forms.Form
	'UPGRADE_WARNING: Arrays in structure rs may need to be initialized before they can be used. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="814DF224-76BD-4BB4-BFFB-EA359CB9FC48"'
	Dim db As DAO.Database
	Dim rs As DAO.Recordset
	Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
		If Option1.Checked = True And Text1.Text <> "" Then
			rs = db.OpenRecordset("Select * from STD where city = '" & UCase(Trim(Text1.Text)) & "'")
			If rs.RecordCount <> 0 Then
				Frame2.Visible = True
				Label7.Text = "The STD Code for " & rs.Fields(0).Value & " is 0" & rs.Fields(1).Value
			Else
				Frame2.Visible = True
				Label7.Text = "Please type the correct city name"
			End If
		ElseIf Option2.Checked = True And Text1.Text <> "" Then 
			rs = db.OpenRecordset("Select * from STD where code = " & Val(Text1.Text))
			If rs.RecordCount <> 0 Then
				rs.MoveLast()
				Frame2.Visible = True
				rs.MoveFirst()
				Label7.Text = "The City Name for the STD Code - 0" & rs.Fields(1).Value & " is " & vbCrLf
				While rs.EOF <> True
					Label7.Text = Label7.Text & rs.Fields(0).Value & ", "
					rs.MoveNext()
				End While
			Else
				Frame2.Visible = True
				Label7.Text = "Please type the correct STD Code"
			End If
		Else
			MsgBox("Enter City Name or STD Code", MsgBoxStyle.Information)
		End If
		
	End Sub
	
	Private Sub Command2_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command2.Click
		Option1.Checked = True
		Text1.Text = ""
		Frame2.Visible = False
	End Sub
	
	Private Sub Command3_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command3.Click
		Me.Close()
		Form1.Show()
	End Sub
	
	Private Sub Form5_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		db = DAODBEngine_definst.OpenDatabase(My.Application.Info.DirectoryPath & "\Database\DirDB.mdb")
		
	End Sub
	
	Private Sub Label3_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Label3.Click
		Me.Close()
		Form8.Show()
	End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -