RNJarvis
8/31/2016 - 12:40 PM

Switching KSMS Databases during Application/InitializeBatch event

Switching KSMS Databases during Application/InitializeBatch event

   ' MUST BE IN...
   ' Application_InitializeBatch

   ' TESTING
   ' Modify source database location - KSMS
   OutputDebugString "KfxKTM_Starting KSMS Database Switch"

   Dim oDb As CscDatabase
   Set oDb = Project.Databases.ItemByName("DynamicSupplier")
   Dim strCustomer As String
   strCustomer = pXRootFolder.XValues.ItemByName("AC_FIELD_" & "DynamicSupplierDB").Value
   OutputDebugString "KfxKTM_ACFIELD_DynamicSupplierDB: " & strCustomer

   If strCustomer = "1" Then
      oDb.ADBSDatabaseName = "Customer1"
      OutputDebugString "KfxKTM_KSMS Database Set to: " & strCustomer
   End If
   If strCustomer = "2" Then
      oDb.ADBSDatabaseName = "Customer2"
      OutputDebugString "KfxKTM_KSMS Database Set to: " & strCustomer
   End If