 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Nostra Damus Guest
|
Posted: Thu Aug 21, 2003 8:06 pm Post subject: Need professional optimized approach to this problem [dbgrid |
|
|
I need to take the values from a column of selected rows from a DBGrid
( dgMultiselect is set ) and use them as parameters for another query.
Scenario: DBGrid is displaying the resultset of a Query. When user
selects some rows, every time he releases the mouse button, another
query should execute taking values from (the first column of) these
selected rows.
This is what I have in the dbgridMouseUp event handler:
*********************begin code*********************
for c := 0 to dbgrid1.SelectedRows.Count-1 do
begin
dbgrid1.DataSource.DataSet.GotoBookmark(
pointer(dbgrid1.SelectedRows[c]) );
// ????? dbgrid1.DataSource.DataSet.FieldByName('invoiceNo').Value
// here, i want selected Invoice Nos. to be passed as a
// parameter(s) to another query, a dynamic array of Integers maybe?
// Which brings me to another problem, how do I pass multiple integer
// values as a parameter to a query considering I am using the
// SELECT * FROM myTable WHERE myField IN (x,y,z);
// syntax? Is there another way this can be done and can I scrap this
// query?
end;
*********************end code*********************
Any suggestions appreciated.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|