📄 form1.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form1
Caption = "显示T_STUDENT表中的T_S_NAME字段值供选择"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command1
Caption = "退出"
Height = 375
Left = 3000
TabIndex = 1
Top = 2280
Width = 1455
End
Begin VB.ListBox LstName
DataSource = "Adodc1"
Height = 780
Left = 360
TabIndex = 0
Top = 240
Width = 2535
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 240
Top = 2280
Width = 2535
_ExtentX = 4471
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=db_student;Data Source=mynetserver"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=db_student;Data Source=mynetserver"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "t_student"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
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
'单击退出按钮的执行代码
Private Sub Command1_Click()
Unload Me
End Sub
'窗体启动时的执行代码
Private Sub Form_Load()
'Adodc1.Recordset.Fields(1)代表T_S_NAME字段的值
Do While Not Adodc1.Recordset.EOF And Not Adodc1.Recordset.BOF
LstName.AddItem (Adodc1.Recordset.Fields(1))
Adodc1.Recordset.MoveNext
Loop
End Sub
'单击列表框时显示选择的值
Private Sub LstName_Click()
MsgBox (LstName.Text)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -