Data Binding in vb 6.0

Asked By Prakash Thirumoorthy
02-Feb-10 03:22 AM
Earn up to 0 extra points for answering this tough question.
Hi Experts,


                 I am using Vb6.0. i need to bind a data field into combobox. 
whether the following coding i run and it shows error like unable to bind to field or datamemer "NameField"

query=" Select Id,NameField from Table1"
    RS.Open Query, Con, 1, 3
    
    Set Combo1.DataSource = RS
    Combo1.DataField = "NameField"
    Combo1.DataMember = "NameField"


pls anyone help me....


  re: Data Binding in vb 6.0

paresh tank replied to Prakash Thirumoorthy
02-Feb-10 03:33 AM
Hi Prakash,
 
What kind of recordset are you using in the data environment.
Some recordsets do not pick up changes to the data.

Have you refreshed the recordset?

  re: Data Binding in vb 6.0

Nithin Rai replied to Prakash Thirumoorthy
02-Feb-10 05:08 AM

Data Member should be set first and then Data Field

  re: re: Data Binding in vb 6.0

Prakash Thirumoorthy replied to Nithin Rai
02-Feb-10 05:15 AM
i did that also, but the same error has occuured
  re: re: Data Binding in vb 6.0
Prakash Thirumoorthy replied to paresh tank
02-Feb-10 05:18 AM
actually i m using adodb environment
  re: re: re: Data Binding in vb 6.0
Nithin Rai replied to Prakash Thirumoorthy
02-Feb-10 05:36 AM

when we do it in design mode,

data source = connection object

data member = command object

data field = Filed  which is retrieved using command

Create New Account