0

我想使用 Visual Basic 6 项目的 DHTML 类型来创建一个可以与数据库交互的 html 页面。msdn 有一个例子:http: //msdn.microsoft.com/en-us/library/aa229040 (v=vs.60).aspx 在这个例子中使用了一个 BindingCollection 对象,而在我的 vb6 中没有定义这样的对象!代码是:

Dim colBind As BindingCollection

Private Sub DHTMLPage_Load()
' Create a BindingCollection object, then set its
' DataSource property to your data environment and its
' DataMember property to the Customers command object.
Set colBind = New BindingCollection
With colBind
Set .DataSource = MyDataEnvironment
.DataMember = "Customers"

' Bind the Value property of elements on the HTML page
' to fields in the Customers recordset.
.Add CustomerID, "Value", "CustomerID"
.Add CompanyName, "Value", "CompanyName"
.Add Address, "Value", "Address"
.Add City, "Value", "City"
.Add Region, "Value", "Region"
.Add PostalCode, "Value", "PostalCode"
.Add Country, "Value", "Country"
End With

End Sub
4

1 回答 1

2

您需要将 BindingCollection 对象的类型库的引用添加到您的项目中。要添加引用,请在“项目”菜单上选择“引用”,然后在“引用”对话框中选择“Microsoft 数据绑定集合”。

于 2013-11-07T07:06:10.310 回答