Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
4 posts • Page 1 of 1
To create the fields of your SQL query in run-time, use the following code:
After that add calculated field and then open the query.
Code: Select all
MSQuery.FieldDefs.Update; for i := 0 to MSQuery.FieldDefList.Count - 1 do with MSQuery.FieldDefList[i] do if (DataType ftUnknown) and not (DataType in ObjectFieldTypes) then CreateField(MSQuery, nil, MSQuery.FieldDefList.Strings[i]);