I am trying to implement a sort function for displaying query results in a MSHFlexgrid from an access database. The user selects which field they would like to sort by from a list box. I am getting a syntax error on the following line:


SelPM = "SELECT * FROM Pattern ORDERED BY " + Selected + ";"

I have also tried:
SelPM = "SELECT * FROM Pattern ORDERED BY """ + Selected + """;"

and a few other combinations.

The variable 'Selected' is specified by the user by filling in the sort dialog box. The proper value is being put into the 'Selected' variable, I can see it in the debugger. Any ideas would be appreciated. Thank you.