To dynamically choose at run time, what database manage a file (HyperFile or AS/400), you have to use functions:
HOpenConnection, HDescribeConnection, HChangeConnection, HDeclareExtern.
Import file descriptions from AS/400.
If files are initially in HyperFile format, export them to AS/400, then, import them.
Keep files in « AS/400
Keep AS/400 files in « AS400 » type in the
analysis, even if they are mostly used in HyperFile mode; Extended info are visible only when the file has an AS/400 type.
For that, you just have to keep the files attached to a connection in the
analysis.
At run time, use function HDescribeConnection to describe an HyperFile connection, and change the connection with HChangeConnection for all the files that need to be handled in HF mode.
SQL Query « test » will also be possible, because it runs the « project initialization code ». You just have to run HChangeConnection in the Project initialization Code. Function OnTestMode() can be used to know if we are running a test or an application.
Note:
In this case, connection defined in the analysis is only used to import file descriptions, edit SQL queries, …
You cannot use "LiveData" when your application change dynamically the connections.