Thread View: borland.public.delphi.winforms.controls.using
1 messages
1 total messages
Started by Brigitte Spatz
Tue, 17 Oct 2006 10:40
Problem with combobox
Author: Brigitte Spatz
Date: Tue, 17 Oct 2006 10:40
Date: Tue, 17 Oct 2006 10:40
37 lines
2458 bytes
2458 bytes
On my login form I have a combobox where a customer has to be selected.
The user may or may not have access rights to the customer's data. These
rights have been saved in a database table. If the user has access
rights, all is well. However, if he tries to log in with a customer for
which he has no access rights, he gets an error message. This is alright
too. Now if he consequently changes to another entry of the combobox,
the SelectedIndex/SelectedValue don't get updated and the database query
now runs with the wrong customer ID (that of the first, unsuccessful
attempt), which obviously results in the user not being granted access.
I have tried all and sundry but cannot figure out how to get at the
correct SelectedValue. As a matter of fact, after the second attempt
(i.e. that with a valid customer but with a wrong SelectedValue in the
corresponding query) the combobox once again displays the value of the
previous customer.
The databinding of the combobx is set up as follows:
with combobox1 do
begin
DataBindings.Add('SelectedValue', dataview1, compID);
DisplayMember := compSign;
ValueMember := compID;
DataSource := ds.Tables['Company'];
end;
The query is
db.get_dataset(ds,'Select * from tbl_sysusermember where fld_user = ' +
ds.tables['Benutzer'].rows[0].item['usernmb'].ToString +
' and fld_company = ' + combobox1.SelectedValue.ToString ,da,
'Rechte',false);
Any ideas?
TIA.
Brigitte
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads