StrataFrame Forum

Switch data source during runtime

http://forum.strataframe.net/Topic8116.aspx

By Chan - 4/14/2007

Hi,

Is it possible to switch data source (SQL Server -> Oracle / SQL Server -> VFP) during runtime? How?

Thank you

By Chan - 4/17/2007

Hi,

Any update?

By StrataFrame Team - 4/17/2007

Yes, you can swap data sources at runtime.  You just need to call MicroFour.StrataFrame.DataBasics.DataSources.Remove("key") and then add a new data source to the collection with the same key, but of a different type (say, OracleDataSourceItem instead of VfpDataSourceItem).  You'll just need to make sure that if a business object talks to both, that all of the data types match up.

You also might need to change the config on your business objects some: say if the Oracle needs the sequence name for primary key insertion.