?? 自定義sql語句查詢.frm
字號(hào):
VERSION 5.00
Object = "{E95A2510-F3D1-416D-823B-4F840FE98091}#3.0#0"; "Command.ocx"
Begin VB.Form Form11
BorderStyle = 1 'Fixed Single
Caption = "自定義 SQL 語句查詢"
ClientHeight = 3270
ClientLeft = 45
ClientTop = 480
ClientWidth = 8865
LinkTopic = "Form11"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 3270
ScaleWidth = 8865
Begin VB.PictureBox Picture1
BackColor = &H00FFFFFF&
Height = 300
Left = 5085
ScaleHeight = 240
ScaleWidth = 3585
TabIndex = 6
Top = 195
Width = 3645
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "字段名稱 - 字段類型 - 字段長(zhǎng)度"
Height = 180
Left = 75
TabIndex = 7
Top = 45
Width = 2700
End
End
Begin VB.ListBox List1
Height = 2580
Left = 5085
Sorted = -1 'True
TabIndex = 5
Top = 525
Width = 3645
End
Begin CSCommand.Command Command1
Height = 375
Left = 3420
TabIndex = 4
Top = 2760
Width = 1560
_ExtentX = 2752
_ExtentY = 661
IconAlign = 0
Icon = "自定義SQL語句查詢.frx":0000
Caption = "開始查詢 &S"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.TextBox Text1
Height = 1650
Left = 240
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 3
Top = 945
Width = 4740
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "自定義SQL語句查詢.frx":001C
Left = 2250
List = "自定義SQL語句查詢.frx":002C
Style = 2 'Dropdown List
TabIndex = 0
Top = 195
Width = 2730
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "自定義 SQL 語句:"
Height = 240
Left = 240
TabIndex = 2
Top = 615
Width = 2040
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "選擇需要查詢的數(shù)據(jù)庫:"
Height = 180
Left = 240
TabIndex = 1
Top = 240
Width = 1980
End
End
Attribute VB_Name = "Form11"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人為我,我為人人
'枕善居收藏整理
'發(fā)布日期:2007/12/24
'描 述:商務(wù)名片及客戶資料管理系統(tǒng) Ver 1.73
'網(wǎng) 站:http://www.Mndsoft.com/ (VB6源碼博客)
'網(wǎng) 站:http://www.VbDnet.com/ (VB.NET源碼博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代碼別忘記給枕善居哦!
'****************************************************************************
Option Explicit
Private Sub Combo1_Click()
'MsgBox "validate"
Dim db As Database
Dim sc As Recordset
Set db = OpenDatabase(MdbPath)
'MsgBox Combo1.ListIndex
Select Case Combo1.ListIndex
Case 0
Set sc = db.OpenRecordset("com")
Case 1
Set sc = db.OpenRecordset("ren")
Case 2
Set sc = db.OpenRecordset("baifang")
Case 3
Set sc = db.OpenRecordset("urls")
End Select
Dim i As Integer
List1.Clear
For i = 0 To sc.Fields.Count - 1
List1.AddItem sc.Fields(i).Properties("name") & " - " & CType(sc.Fields(i).Properties("Type")) & " - " & sc.Fields(i).Properties("Size")
Next i
sc.Close
db.Close
End Sub
Private Sub Command1_Click()
If Len(Trim(Text1.Text)) < 15 Then
MsgBox "SQL 查詢語句長(zhǎng)度不夠,無法傳遞此語句。", vbInformation
Text1.SetFocus
Exit Sub
End If
Text1.Text = Trim(Text1.Text)
Select Case Combo1.ListIndex
Case 0:
allshow Text1.Text
Case 1:
ShowAllRen Text1.Text
Case 2
ShowAllBaiFang Text1.Text
Case 3
ShowAllUrls Text1.Text
End Select
End Sub
Private Sub Form_Load()
Me.Icon = MDIForm1.Icon
Me.BackColor = FormBackColor
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 3
Dim db As Database
Dim sc As Recordset
Set db = OpenDatabase(MdbPath)
Combo1.ListIndex = 0
Select Case Combo1.ListIndex
Case 0
Set sc = db.OpenRecordset("com")
Case 1
Set sc = db.OpenRecordset("ren")
Case 2
Set sc = db.OpenRecordset("baifang")
Case 3
Set sc = db.OpenRecordset("urls")
End Select
Dim i As Integer
List1.Clear
For i = 0 To sc.Fields.Count - 1
List1.AddItem sc.Fields(i).Properties("name") & " - " & CType(sc.Fields(i).Properties("Type")) & " - " & sc.Fields(i).Properties("Size")
Next i
sc.Close
db.Close
End Sub
Private Function CType(i As Integer) As String
If i = 10 Then
CType = "Text(文本)"
ElseIf i = 8 Then
CType = "Date(日期)"
ElseIf i = 12 Then
CType = "Memo(備注)"
ElseIf i = 4 Then
CType = "Long(長(zhǎng)整)"
Else
CType = "(未知類型)"
End If
End Function
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -