building SQL string from a multiselect list box

  • Thread starter Thread starter tim johnson
  • Start date Start date
T

tim johnson

I have a listbox with Multiselect is set true. I can
select multiple rows by holding down the Cobtrol button.

If the listbox is called lstDisplay and I select several
rows how can I build it to a SQL string to use in a
procedure. All I need help with is how to build the SQL
sting from the values in the list box.
 
Multiselecting won't work because the selected order will always be from top to bottom - no matter what order you made your selections

Turn off multiselect. Create an empty string. Each time you click an item concatenate it to the string. Have a "Done" button at the bottom that you click when the SQL is complete.
 
Multiselecting won't work because the selected order will always be from top to bottom - no matter what order you made your selections.

So? If he's building an IN() or OR... clause in a SQL query, the order
is irrelevant!
 
Back
Top