To use the DMC Viewer from your application you can use two techniques depending on the type of Table to open
TPS and DAT Files can be accessed directly (like in the demo application by passing on the full path and name)
You can use any technique you wish to pass on this path name but always use as we did in the demo application a "fake" ProjID#
You can use the demo procedure DMC_RT_MRU and import it in your application to allow your end users to use the VIEWER on preselected SQL Tables
You can either :
1. clean out YOUR dev MRU TPS Table and fill it with the Tables you want to allow your end users to visualize (and use the RT_PROCESS to rename ODBC connections settings)
2. from your application use this technique to ADD new tables to the existing MRU tps table (called dmc_mru.dmc and located in the RT engine data path in cgf_import folder)
! ADD dynamically entries to the list offered to the user
! You can add entries in the list here (or anywhere else in your application) with this type of code
mru:TABLENAME = YourTableName ie : 'animals' or 'dbo.animals' etc ...
mru:DRIVER = YourDriverName ie : 'SQL Driver' or 'MySQL ODBC 5.1 Driver' or 'PostgreSQL Unicode' etc ...
mru:CONNECTION = YourCompleteConnectionString ie 'Driver=MySQL ODBC 3.51 Driver;server=212.227.134.13;user=dmcrt_demo;pwd=dmcrt_demo_test;database=dmcrt_demo;port=3306;' etc ....
mru:DB_Name = YourDBName ie : 'dmc_rtdemo'
mru:TYPE = 'SQL' or 'MySQL' or 'PostGre' or 'SQLAny' or 'FireBird' or 'DB2' or 'Pervasive'
IF Access:dmc_mru.TryInsert() = Level:Benign
ELSE
Access:dmc_mru.CancelAutoInc
END
! ***** the mru:TYPE MUST be like shown above for the RT to understand it ******!