Page 1 of 1

TUniBatchMove is an Undeclared identifier

Posted: Tue 13 Mar 2012 16:00
by Jyrkka
Good day,

We have used the Migration Wizard on one of our old, huge and complicated project that makes use of BDE to access Paradox. After the tool had succeed to make all the necessary code conversions, we tried to start the project, but received this error: "[DCC Error] USimple.pas(344): E2003 Undeclared identifier: 'TUniBatchMove'", tried to replace it with TCRBatchMove, but the same error occurs. This type was set in place of TBatchMove. Maybe we have to add another using or/and search path or/and anything else...What have we missed?

Any help would be very appreciated...

Posted: Tue 13 Mar 2012 16:37
by AndreyZ
Hello,

Thank you for the information. We have fixed this problem. This fix will be included in the next UniDAC build.
To solve the problem, you should replace TUniBatchMove with TCRBatchMove in the *.pas and *.dfm files of your project. Also, you should add the CRBatchMove unit to the USES clause of all units that use TCRBatchMove.

Posted: Tue 13 Mar 2012 19:14
by Jyrkka
In this case you may want to adapt the TBatchMove.Mode in *.pas and *.dfm files to replace to proper enumeration values, as I see the prefixes have changed, from bat* to bm*.

More questions to follow...

Posted: Wed 14 Mar 2012 08:30
by AndreyZ
We will investigate this question. Please note that Migration Wizard serves only to simplify migration process. After migration you may need to make some corrections to your project and test it.

Posted: Wed 14 Mar 2012 13:16
by Jyrkka
When migrating from BDE this definetly be the case, because there is need to adapt all the code that uses units, methods, and properties that are specific to BDE like AliasNames and DataBaseName of TDataBase.

Posted: Wed 14 Mar 2012 15:30
by AndreyZ
UniDAC doesn't work with aliases, that's why there is no property corresponding the TDatabase.AliasName one in UniDAC. You should remove the AliasName property usage from your project manually. The TDatabase.DatabaseName and TUniConnection.Database properties have different meanings, that's why Migration Wizard does nothing with TDatabase.DatabaseName.

Posted: Thu 15 Mar 2012 09:20
by Jyrkka
Yes, as we seen, TUniTable has Connection property insted of TTable's DatabaseName, and TUniConnection has Database instead of AliasName, and Name(that is used now in TUniTable Connection field) that seems to come instead of both TDataBase's DatabaseName(that was used in TTable) and Name object identifier...

Posted: Thu 15 Mar 2012 11:51
by AndreyZ
The following example explains the difference between the TUniTable.Connection and TTable.DatabaseName properties:

Code: Select all

var
  Database1: TDatabase;
  Table1: TTable;
  UniConnection1: TUniConnection;
  UniTable1: TUniTable1;
begin
  Database1.DatabaseName := 'test'; // 'test' is not a database name on the server, it is the name that will be used for other BDE components (like TTable)
  Table1.DatabaseName := 'test'; // TTable.DatabaseName uses the database name that is written in the Database1.DatabaseName property, but not the TDatabase component itself
  UniConnection1.Database := 'test'; // 'test' is a database name on the server
  UniTable1.Connection := UniConnection1; // TUniTable.Connection uses the TUniConnection component itself, but not its name
end;
Also, AliasName in BDE means a set of all connection options that were set in BDE Administrator. In UniDAC, you should set all the connection options using the correspondent TUniConnection properties (like Server, Database, Username, Password, Port, etc.).