Want to give Auto complete for Database


I am trying to give users Auto complete feature for Database. Like for example if the database has table names Customers. I want to give facility in Scripter so that one would have to code like this:

I know one way that I can do this is to define classes for each table in database and then register these classes in Scripter. But this is only possible when the structure of database is known in advance.

In our case defining classes is not possible as each of our clients have different database structure and this changes frequently at customers end and that is the reason why we are using Scripter so that our users can modify the database structure at their end and build entry screens in Scripter.

Is there any way by which we can dynamically build classes from database structure and register that class in Scripter at runtime?



You can declare classes with names and add/remove properties from it using DefineProp and RemoveProperty:

  Cust := IDEScripter1.DefineClass(TBaseTable, 'TCustomer');
  Cust.DefineProp('Name', tkString, nil, nil);