2.如下示例
Dim Comb_cx As New ADODB.Recordset
With Comb_cx
If .State = adStateOpen Then
.Close
End If
.ActiveConnection = adoCN
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockBatchOptimistic
.Source = "select distinct gbdq from cx_Htdj "
End If
.Open
End With
Combo2.Clear
If Comb_cx.RecordCount > 0 Then
Comb_cx.MoveFirst
Do While Not Comb_cx.EOF
Combo2.AddItem Comb_cx.Fields("gbdq") & ""
Comb_cx.MoveNext
Loop
End If
Comb_cx.Close