我想使用 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