My friend and I are doing a project, and he has this question:
I am
> currently having some trouble with linking my DBgrid to my data > control. At the moment, the data control is being populated by an
encoded
> SQL query, so i can't link the DBgrid's datasource to the dataconrol in > the properties window because the data control has no recordsource. As > such I have tried to code this in, directly following the SQL statement > that populates the data control's recordsource, using he following > statement: > > Set grdDataGrid.DataSource = datPrimaryRS > > However, I get a data mismatch error and I am unclear why. > Is this the right code? (grdDataGrid = my DBgrid and datPrimaryRS= my > datacontrol) > > Secondly if I want to repopulate the DBgrid every time the user changes > customers must I requery the data control or refresh the dbgrid? > > Thank you,
I am
> currently having some trouble with linking my DBgrid to my data > control. At the moment, the data control is being populated by an
encoded
> SQL query, so i can't link the DBgrid's datasource to the dataconrol in > the properties window because the data control has no recordsource. As > such I have tried to code this in, directly following the SQL statement > that populates the data control's recordsource, using he following > statement: > > Set grdDataGrid.DataSource = datPrimaryRS > > However, I get a data mismatch error and I am unclear why. > Is this the right code? (grdDataGrid = my DBgrid and datPrimaryRS= my > datacontrol) > > Secondly if I want to repopulate the DBgrid every time the user changes > customers must I requery the data control or refresh the dbgrid? > > Thank you,