Anyone uses ADOnis components?

Ok, maybe this sounds crazy to you but listen anyways..

        I have MSSQL server running, which has a table called UserM. This table
contains 3 fields.. UserName(varchar 20), UserCode(char 5), UID(char
32). Now, I haven't set any primary key on this table, however I have
two indexes named ByUserName(index according to field UserName) and
ByUserCode(index according to field UserCode).

        I put a ADOTable component on the form. I have to filter the table
according to a value that the user gives. The filter is suppose to
compare the user given value with the field UserName. Now if I try any
of the following, there's an error. Yes, I have added the UserName &
UserCode fields through the field editor. Anyways, here's what I
tried...

UserGivenValue : string

case 1:
ADOTable1.Open;
ADOTable1.Filter := 'UserName = UserGivenValue';
ADOTable1.Filtered := True;

case 2:
ADOTable1.Open;
ADOTable1.ADOFindFirst(UserGivenValue);

case 3:
ADOTable1.Open;
ADOTable1.Seek(UserGivenValue, soFirstEQ);

        As you can clearly observe, I would like to change indexes at runtime.
When you said MSSQL determines the best index on it's own, what did you
mean? How does MSSQL know which field to index on? To tell you the
truth, I am bit confused. These things did not happen with TTable. So
tell me how to go about it.

Nirav Kaku
Certified Delphi Developer