Cannot assign to a read-only property

database, delphi, runtime

Solution

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

Problem

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: ``` 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 :)

Original source