Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在工作,vb6我有一个带有 id 和名称的表:
vb6
Database mysql 5.5 Table : Employee Field1 : Empid integer (primary, AI) Field2 : EmpName varchar (20)
我想在用户引用时使用vb6组合框显示EmpName给用户和商店。Empidcombobox.value()
EmpName
Empid
combobox.value()
vb6可以吗?有替代品吗?
您可以使用该ComboBox.ItemData属性来存储数字 ID:
ComboBox.ItemData
combobox.Add(rs("EmpName").Value) combobox.ItemData(combobox.NewIndex) = rs("Empid").Value
要获取选定的员工姓名:
strName = combobox.List(combobox.ListIndex)
要获取选定的员工 ID:
intID = combobox.ItemData(combobox.ListIndex)