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!

Datagrid/DEcommand "issues"

Status
Not open for further replies.

caffrinho

MIS
Mar 1, 2002
91
GB
where to start?...

I'm connecting to an mySQL database using ODBC through the DataEnvironment. What i'm trying to do is populate a combobox with the Primary Key of one table {product}
(i can do this, bit) and populate a Datagrid with values from the other table {demand} that relate to this value. Which is where i'm getting stuck.

I have created a command in the dataenvironment, and a child command to filter by productCode but this requires setting at design time.

What i was hoping to do was to change the commandtext property of the command during run time, but am getting lost.

I was hoping i may be able to put something like this in the change event of the combobox:


sqlQry = "SELECT * FROM stockcalc.demand WHERE SKU =" & _
CInt(cboProdCode.Text)

DataEnvironment1.getSkus.CommandText = sqlQry

(getSkus being the command i created in data environment)

This, however doesn't cut it.

Can somebody please put me out of my misery???

C>

p.s. I'm a relative beginner at VB6, particularly with databases, so please...... assume nothing!

 
further to above:

I can create a new command that will run the desired SQL query on the database, and then populate the datagrid manually, but i was really hoping for an easier solution, like the one i mention above where i just change the commandtext property of an existing command bound to the datagrid.

Am i on the right track, is this possible?
Anybody with any pointers? I'd be really grateful.

TIA

C>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top