Hello DW,
After DW's latest updates, i have noticed that we can't use anymore Gui.DropDownList() for tables that contains only one column.
For example we have such code:
Gui.DropdownList("sort1","Billetnet.mdb","Tabel1","Kunstner","Kunstner",prop.get_getValue("sort1"))
DropDownList method generate query:
SELECT Kunstner, Kunstner FROM Tabel1 ORDER BY Kunstner
In this case we have SQL error:
Ambiguous column name ‘Kunstner’.
Also we can’t specify column name like [TableName].[ColumnName], because in this case SQLReader will not contain value by [TableName].[ColumnName] key (because key will be just [ColumnName]). For this reason we also can’t use “as” keyword.
I have solution option.
Gui.DropDownList method. Line 3. In this code line we can directly specify table name for “order by” sentence:
Current line:
IDataReader reader = Database.getDataReader("SELECT " + ValueField + ", " + TextField + " FROM " + Table + " ORDER BY " + TextField + " ", Database);
Proposed line:
IDataReader reader = Database.getDataReader("SELECT " + ValueField + ", " + TextField + " FROM " + Table + " ORDER BY " + Table + “.” + TextField + " ", Database);
This solution not affect other cases, and allow to use Gui.DropDownList() for tables that contains only one column.
Any suggestion?
Best regards
Buba