📄 frmdatacombo.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"
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Begin VB.Form Form1
Caption = "Locate Book Information by Author and ISBN Number"
ClientHeight = 1425
ClientLeft = 60
ClientTop = 345
ClientWidth = 7215
LinkTopic = "Form1"
ScaleHeight = 1425
ScaleWidth = 7215
StartUpPosition = 3 'Windows Default
Begin MSDataGridLib.DataGrid DataGrid1
Bindings = "frmDataCombo.frx":0000
Height = 1050
Left = 1680
TabIndex = 3
Top = 360
Visible = 0 'False
Width = 5535
_ExtentX = 9763
_ExtentY = 1852
_Version = 393216
AllowUpdate = 0 'False
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
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 = 1033
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 = 1033
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc adoAllInfo
Height = 375
Left = 3600
Top = 960
Visible = 0 'False
Width = 1935
_ExtentX = 3413
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=D:\Program Files\Microsoft Visual Studio\VB98\BIBLIO.MDB"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=D:\Program Files\Microsoft Visual Studio\VB98\BIBLIO.MDB"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "Select * from authors"
Caption = "All Info"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton cmdRetrieve
Caption = "Retrieve Books"
Height = 315
Left = 5760
TabIndex = 2
Top = 0
Width = 1455
End
Begin MSAdodcLib.Adodc adoAuthorNames
Height = 375
Left = 1680
Top = 960
Visible = 0 'False
Width = 2295
_ExtentX = 4048
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=D:\Program Files\Microsoft Visual Studio\VB98\BIBLIO.MDB"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=D:\Program Files\Microsoft Visual Studio\VB98\BIBLIO.MDB"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "SELECT Author, Au_ID FROM Authors ORDER BY Author ASC"
Caption = "Author Name"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSDataListLib.DataList DataList1
Bindings = "frmDataCombo.frx":0019
DataSource = "adoBooks"
Height = 1035
Left = 0
TabIndex = 1
Top = 360
Width = 1695
_ExtentX = 2990
_ExtentY = 1826
_Version = 393216
ListField = "ISBN"
BoundColumn = ""
End
Begin MSDataListLib.DataCombo DataCombo1
Bindings = "frmDataCombo.frx":0030
DataSource = "adoAuthorNames"
Height = 315
Left = 0
TabIndex = 0
Top = 0
Width = 5775
_ExtentX = 10186
_ExtentY = 556
_Version = 393216
ListField = "Author"
BoundColumn = ""
Text = "Select an Author"
End
Begin MSAdodcLib.Adodc adoBooks
Height = 405
Left = 5280
Top = 960
Visible = 0 'False
Width = 1935
_ExtentX = 3413
_ExtentY = 714
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=D:\Program Files\Microsoft Visual Studio\VB98\BIBLIO.MDB"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=D:\Program Files\Microsoft Visual Studio\VB98\BIBLIO.MDB"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "SELECT Author FROM Authors"
Caption = "books"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Fig 18.20
' Demonstrating DataCombo and DataList controls
Option Explicit
Dim bookQuery, allInfoQuery As String
Private Sub Form_Load()
On Error Resume Next
bookQuery = _
"SELECT Authors.Author, [Title Author].ISBN " & _
"FROM Authors INNER JOIN [Title Author] ON " & _
"Authors.Au_ID = [Title Author].Au_ID " & _
"WHERE Authors.Author = "
allInfoQuery = _
"SELECT DISTINCT Titles.Title, Publishers.Name, " & _
"Titles.[Year Published] " & _
"FROM (Publishers INNER JOIN Titles ON " & _
"Publishers.PubID = Titles.PubID) INNER JOIN " & _
"(Authors INNER JOIN [Title Author] ON " & _
"Authors.Au_ID = [Title Author].Au_ID) ON " & _
"Titles.ISBN = [Title Author].ISBN WHERE " & _
"Titles.ISBN = "
End Sub
Private Sub cmdRetrieve_Click()
On Error Resume Next
DataGrid1.Visible = False
adoBooks.RecordSource = bookQuery & _
"'" & DataCombo1.Text & "'"
Call adoBooks.Refresh
End Sub
Private Sub DataList1_Click()
On Error Resume Next
adoAllInfo.RecordSource = allInfoQuery & _
"'" & DataList1.Text & "'"
adoAllInfo.Refresh
DataGrid1.Visible = True
End Sub
Private Sub Form_Resize()
' set dimensions of GUI components on scaling of window
DataCombo1.Width = ScaleWidth - cmdRetrieve.Width
DataList1.Height = ScaleHeight - DataCombo1.Height
DataGrid1.Width = ScaleWidth - DataList1.Width
DataGrid1.Height = DataList1.Height
cmdRetrieve.Left = ScaleWidth - cmdRetrieve.Width
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -