📄 person.frm
字号:
VERSION 5.00
Begin VB.Form frmODBC
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Caption = "Chapter 6.2 Example"
ClientHeight = 3360
ClientLeft = 1560
ClientTop = 1950
ClientWidth = 3705
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 3360
ScaleWidth = 3705
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdQuit
Caption = "Quit"
Default = -1 'True
Height = 375
Left = 2580
TabIndex = 13
Top = 2550
Width = 975
End
Begin VB.TextBox txtZip
DataSource = "dtaData"
Height = 285
Left = 900
TabIndex = 11
Top = 2520
Width = 1335
End
Begin VB.TextBox txtState
DataSource = "dtaData"
Height = 285
Left = 900
TabIndex = 9
Top = 2160
Width = 2655
End
Begin VB.TextBox txtCity
DataSource = "dtaData"
Height = 285
Left = 900
TabIndex = 7
Top = 1800
Width = 2655
End
Begin VB.TextBox txtAddress2
DataSource = "dtaData"
Height = 285
Left = 900
TabIndex = 6
Top = 1320
Width = 2655
End
Begin VB.TextBox txtAddress1
DataSource = "dtaData"
Height = 285
Left = 900
TabIndex = 4
Top = 960
Width = 2655
End
Begin VB.TextBox txtName
DataSource = "dtaData"
Height = 285
Left = 900
TabIndex = 2
Top = 480
Width = 2655
End
Begin VB.TextBox txtContact
DataSource = "dtaData"
Height = 285
Left = 900
TabIndex = 0
Top = 120
Width = 2655
End
Begin VB.Data dtaData
Align = 2 'Align Bottom
Caption = "Personnel Database"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 'DefaultCursor
DefaultType = 1 'UseODBC
Exclusive = 0 'False
Height = 345
Left = 0
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 3015
Width = 3705
End
Begin VB.Label lblPerson
Alignment = 1 'Right Justify
BackColor = &H00C0C0C0&
Caption = "Zip:"
Height = 255
Index = 5
Left = -180
TabIndex = 12
Top = 2550
Width = 1005
End
Begin VB.Label lblPerson
Alignment = 1 'Right Justify
BackColor = &H00C0C0C0&
Caption = "State:"
Height = 255
Index = 4
Left = -180
TabIndex = 10
Top = 2190
Width = 1005
End
Begin VB.Label lblPerson
Alignment = 1 'Right Justify
BackColor = &H00C0C0C0&
Caption = "City:"
Height = 255
Index = 3
Left = -180
TabIndex = 8
Top = 1830
Width = 1005
End
Begin VB.Label lblPerson
Alignment = 1 'Right Justify
BackColor = &H00C0C0C0&
Caption = "Address:"
Height = 255
Index = 2
Left = -180
TabIndex = 5
Top = 990
Width = 1005
End
Begin VB.Label lblPerson
Alignment = 1 'Right Justify
BackColor = &H00C0C0C0&
Caption = "Company:"
Height = 255
Index = 1
Left = -180
TabIndex = 3
Top = 510
Width = 1005
End
Begin VB.Label lblPerson
Alignment = 1 'Right Justify
BackColor = &H00C0C0C0&
Caption = "Contact:"
Height = 255
Index = 0
Left = -180
TabIndex = 1
Top = 150
Width = 1005
End
End
Attribute VB_Name = "frmODBC"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdQuit_Click()
End
End Sub
Private Sub Form_Load()
'Set up the form and connect to data source
Dim dbfTemp As Database, recTemp As Recordset
'Connect to the database
'Change this to your data source
dtaData.Connect = "ODBC;DSN=Personnel Database"
'Set the data control's RecordSource property
'Change this to your table name
dtaData.RecordSource = "SELECT * FROM Contacts"
'Connect each of the text boxes with the appropriate fieldname
txtContact.DataField = "Contact"
txtName.DataField = "Name"
txtAddress1.DataField = "Addr1"
txtAddress2.DataField = "Addr2"
txtCity.DataField = "City"
txtState.DataField = "State"
txtZip.DataField = "Zip"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -