Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to Bind to Field Or DataMember

Status
Not open for further replies.

bigleroy

Programmer
Mar 1, 2002
7
US
I am receiving the following error when I try to connect a database combobox to a SQLServer based recordset.

The Error: Run-time error '545':
Unable to bind to field or data member: "VendorType"

Here is the code I am using

Dim cnnProvType As ADODB.Connection

Dim recProvType As ADODB.Recordset



Private Sub dbcProviderType_Click(Area As Integer)
Set cnnProvType = New ADODB.Connection
cnnProvType.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CustSvc;Data Source=POKEMON"
cnnProvType.Open

Set recProvType = New ADODB.Recordset
recProvType.Open "SELECT VendorType FROM SOPHIA..VendorType " _
& "ORDER BY VendorType", _
cnnProvType, _
adOpenStatic, _
adLockOptimistic, _
adCmdText

Set dbcProviderType.DataSource = recProvType
Set dbcProviderType.RowSource = recProvType
dbcProviderType.DataField = "VendorType"
dbcProviderType.ListField = "VendorType"
dbcProviderType.BoundColumn = "VendorType"
End Sub

Any thoughts?

Thanks,
Ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top