请问一下如何获取数据库某字段值到Combo?
请问一下如何获取数据库某值到Combo?获取数据库表中(Name)的所有值列到Combo中选择?? 推~@@ 剛好要學這個,但願有高人出來指點 推~@@ 剛好要學這個,但願有高人出來指點 创建Combo控件时设置text段为空,如
$hCYVer = GUICtrlCreateCombo("", 354, 30, 72, 18, BitOR($GUI_SS_DEFAULT_COMBO, $CBS_DROPDOWNLIST))
然后用循环给控件赋值,如:
For $i = 1 To $aCYVer
GUICtrlSetData($hCYVer, $aCYVer[$i])
Next Func _GetName()
$Conn = ObjCreate("ADODB.Connection")
$Rs = ObjCreate("ADODB.Recordset")
$Conn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $MdbDir & ";Jet Oledb:Database Password=" & $MdbPW)
$Rs.ActiveConnection = $Conn
$Rs.Open('Select * From Operation')
GUICtrlSetData($Name_Combo, "")
While (Not $Rs.eof And Not $Rs.bof)
???
WEnd
$Rs.Close
$Conn.Close
EndFunc
页:
[1]