无法分配给只读属性

时间:2022-09-12 08:43:40

I'm trying to change the database and the tablename against a TTable component during run time, however this error keeps appearing at this line:

我正在尝试在运行时更改数据库和tablename对TTable组件,但是此错误仍然出现在此行:

  E2129 Cannot assign to a read-only property

The code I am trying to use is as follows:

我试图使用的代码如下:

  tblDest.Database  := lvDestAlias;
  tblDest.TableName := lvDestAlias;

The variables in use are strings that have previously been initialised. So yeah if you could help in anyway I would appreciate it :)

使用的变量是先前已初始化的字符串。所以是的,如果你能提供帮助,我会很感激:)

1 个解决方案

#1


5  

your problem is in the Database property which is read-only, you must set the DatabaseName property instead.

您的问题是在只读的Database属性中,您必须设置DatabaseName属性。

#1


5  

your problem is in the Database property which is read-only, you must set the DatabaseName property instead.

您的问题是在只读的Database属性中,您必须设置DatabaseName属性。