Form Application with changeble Tables

In form applications, it is possible the name of the database table in a global variable to save (see the SQL properties). So far so good. So I have a prototype at design time using the data Banka barking and entered the variable [table name] and the name of the prototype table.

At runtime, I use an event in the global variable

[tablename] = T_MyTable;

The application shows but only to the Prototytabelle and also collects the data entered there.

Did I understand the function of storage of the table name in a variable wrong … Or just wrong implemented? Unfortunately, I find no corresponding example or tutorial …

Re: Form Application with changeble Tables

If I understand correctly, you are trying to use a variable in the SQL to save to different tables. The problem I see is that the form is also using the connection/table assigned when you created the form and is perhaps overriding the variable in your SQL?

You may have to set the table in the onApplicationInit and go after the SC connection value instead of changing the SQL statement.

ex:
http://www.scriptcase.net/forum_en_us/index.php?topic=1626.0

Regards,
Scott.

Re: Form Application with changeble Tables

Hi Scott,

I think you have understood correctly. I have at design time only the prototype of the table. So do I configure the webbseite in Scriptcase.
At runtime, I have an unknown number of data tables as a detail table which always belong to a record in a master table. The site is an Application Form that contains a block in the detail table is also a form-application. Since the detailed tables, always use an identical SQL statement, in which only changes the name of the table, was my approach that the global variable [table_name] de name of the table.

Sure the man can also solve a detail table in the database and request a Where clause, the data of the master record. Since, however, must be made to the data table extensive calculations, should take care of the Datenebankserver, I thought it would be more effective if the data is stored immediately in separate tables.

Honestly, I have no desire to look in the generated Scriptcase PHP - Scripts for the internal variables and to replace them in events.

Nevertheless, Thank you for your solution. I have it now (for now) solved with a data table. I would be interested but still what it has on the table name in a global variables,

Greetings from Berlin (Germany)