2
如何在运行期间使用存储过程填充组合框以从数据库获取值?使用vb6中的存储过程填充组合框
这里是我的代码,这应该转换成存储过程:
Private Sub ComboFill()
Set Rs = New ADODB.Recordset
Set Cmd = New ADODB.Command
With Cmd
.ActiveConnection = Conn
.CommandType = adCmdText
.CommandText = "SELECT suppliername from supplier"
Set Rs = .Execute
End With
If Not (Rs.BOF And Rs.EOF) Then
Rs.MoveFirst
End If
Do Until Rs.EOF
txtsupplier.AddItem Rs.Fields("suppliername").Value
Rs.MoveNext
Loop
End Sub
你试过了什么? Google仍然是免费的。 – 2013-03-21 16:09:27
@ user2063626:已更新帖子。一探究竟。 – 2013-03-21 16:35:27