//AB/ Project Wizard db Connect db //AB/ Object prj is a Dialog_Project //AB/ Set ProjectName to "Wizard db Connect db" //AB/ Set ProjectFileName to "ConnectWizardDb.DG" //AB/ Set Size to 296 375 // Project Object Structure // oConnectDbWizard is a cWizard // Sncsys_DD is a DataDictionary // Snctable_DD is a DataDictionary // Sncthea_DD is a DataDictionary // Snctrow_DD is a DataDictionary // oWelcomePage is a cWelcomePage // oSelectDatabaseFormatPage is a cInteriorPage // oTable_tb is a cTextbox // oFromdb_grp is a cRDSDbGroup // oSnctable_Fromdbtype is a cDbComboformFormat // oSnctable_Fromdriver is a cDbComboformDriver // oTodb_grp is a cRDSDbGroup // oSnctable_Todbtype is a cDbComboformFormat // oSnctable_Todriver is a cDbComboformDriver // oDataFlex is a cInteriorPage // oPath_fm is a cDbFormPath // oBrowse_bn is a cPathButton // oTable_fm is a cDbComboformDataTable // oViewData_bn is a cViewDataButton // oSnctable_Fromserver is a cDbComboformServer // oSnctable_Toserver is a cDbComboformServer // oIBMDB2 is a cInteriorPage // oSelectIBMDB2Table is a cInteriorPage // oTables_lst is a List // oViewData_bn is a Button (Duplicate object name) // oMSSQL is a cInteriorPage // oSelectMSSQLTable is a cInteriorPage // oTables_lst is a List (Duplicate object name) // oViewData_bn is a Button (Duplicate object name) // oODBC is a cInteriorPage // oTable_tb is a cTextbox (Duplicate object name) // oDSN_lst is a Grid // oDSNArray is a Array // oFileDSN_bn is a Button // oDialog is a Opendialog // oODBCAdmin_bn is a Button // oDSN_grp is a RadioGroup // Radio4 is a Radio // Radio5 is a Radio // Radio6 is a Radio // oODBCBitmap_bn is a cBitmapButton // oText is a Textbox // oSelectODBCTable is a cInteriorPage // oTables_lst is a List (Duplicate object name) // oViewData_bn is a Button (Duplicate object name) // oOracle is a cInteriorPage // oSelectOracleTable is a cInteriorPage // oTables_lst is a List (Duplicate object name) // oViewData_bn is a Button (Duplicate object name) // oPervasive is a cInteriorPage // oInfo_tb is a cTextbox // oOpenDialog is a OpenDialog // oPath_fm is a Form (Duplicate object name) // oBrowse_bn is a Button (Duplicate object name) // oTable_fm is a cRDSForm (Duplicate object name) // oSelectPervasiveTable is a cInteriorPage // oTables_lst is a List (Duplicate object name) // oViewData_bn is a Button (Duplicate object name) // oLogin is a cInteriorPage // oInfo_tb is a cTextbox (Duplicate object name) // oInfo2_tb is a cTextbox // oServer_fm is a Form // oAuthentication_cb is a CheckBox // oUser_fm is a Form // oPassword_fm is a Form // oDatabase_fm is a Form // oSchema_fm is a Form // oTest_bn is a Button // oConstraints is a cInteriorPage // oSelectMethodPage is a cInteriorPage // oMethodText is a cTextbox // oSynchType_rg is a RadioGroup // Radio1 is a Radio // Radio2 is a Radio // Radio3 is a Radio // oFieldRange is a cInteriorPage // oInfo_tb is a cTextbox (Duplicate object name) // oSelectedFieldNumbers is a cInteriorPage // oInfo_tb is a cTextbox (Duplicate object name) // oAnsiOEM is a cInteriorPage // oInfo_tb is a cTextbox (Duplicate object name) // oNulDefaults is a cInteriorPage // oCompletionPage is a cCompletionPage // oTextBox1 is a Textbox // oSnctable_Checkintegrity is a dbCheckBox // oSncTable_Text_fm is a dbForm // Register all objects Register_Object oAnsiOEM Register_Object oAuthentication_cb Register_Object oBrowse_bn Register_Object oCompletionPage Register_Object oConnectDbWizard Register_Object oConstraints Register_Object oDatabase_fm Register_Object oDataFlex Register_Object oDialog Register_Object oDSN_grp Register_Object oDSN_lst Register_Object oDSNArray Register_Object oFieldRange Register_Object oFileDSN_bn Register_Object oFromdb_grp Register_Object oIBMDB2 Register_Object oInfo_tb Register_Object oInfo2_tb Register_Object oLogin Register_Object oMethodText Register_Object oMSSQL Register_Object oNulDefaults Register_Object oODBC Register_Object oODBCAdmin_bn Register_Object oODBCBitmap_bn Register_Object oOpenDialog Register_Object oOracle Register_Object oPassword_fm Register_Object oPath_fm Register_Object oPervasive Register_Object oSchema_fm Register_Object oSelectDatabaseFormatPage Register_Object oSelectedFieldNumbers Register_Object oSelectIBMDB2Table Register_Object oSelectMethodPage Register_Object oSelectMSSQLTable Register_Object oSelectODBCTable Register_Object oSelectOracleTable Register_Object oSelectPervasiveTable Register_Object oServer_fm Register_Object oSncTable_Text_fm Register_Object oSnctable_Checkintegrity Register_Object oSnctable_Fromdbtype Register_Object oSnctable_Fromdriver Register_Object oSnctable_Fromserver Register_Object oSnctable_Todbtype Register_Object oSnctable_Todriver Register_Object oSnctable_Toserver Register_Object oSynchType_rg Register_Object oTable_fm Register_Object oTable_tb Register_Object oTables_lst Register_Object oTest_bn Register_Object oText Register_Object oTextBox1 Register_Object oTodb_grp Register_Object oUser_fm Register_Object oViewData_bn Register_Object oWelcomePage Register_Object Radio1 Register_Object Radio2 Register_Object Radio3 Register_Object Radio4 Register_Object Radio5 Register_Object Radio6 Register_Object Sncsys_DD Register_Object Snctable_DD Register_Object Sncthea_DD Register_Object Snctrow_DD //AB-StoreTopStart Use Func.pkg Use SyncFuncs.pkg Use vWin32fh.pkg Use ViewData.dg Use Append.dg //Register_Function DEO_Object Returns Integer //Open SncSys //AB-StoreTopEnd //AB-IgnoreStart Use cWizard.Pkg Use DataDict.pkg Use Windows.pkg Use cRDSDbGroup.pkg Use cDbComboformFormat.pkg Use cDbComboformDriver.pkg Use cDbFormPath.pkg Use cPathButton.pkg Use cDbComboformDataTable.pkg Use cViewDataButton.pkg Use cDbComboformServer.pkg Use dfRadio.pkg Use cBitmapButton.pkg Use File_dlg.Pkg Use cRDSForm.pkg Use dfEnChk.pkg Use dfEntry.pkg //AB-IgnoreEnd //AB-IgnoreStart Use SNCSYS.DD Use SNCTABLE.DD Use SNCTHEA.DD Use SNCTROW.DD //AB-IgnoreEnd Object oConnectDbWizard Is A cWizard //AB-StoreTopStart Use DD_Debug.dg Property Integer piFromDDFFile (IsHighFileListNumber() + 2) Property Integer piToDDFFile (IsHighFileListNumber() + 3) //AB-StoreTopEnd Set Location To 2 1 Set psHeaderGraphic To "Cm48x48.bmp" Set psLabel To "Database Tables Setup Wizard" //AB-DDOStart Object Sncsys_DD Is A Sncsys_DataDictionary End_Object // Sncsys_DD Object Snctable_DD Is A SncTable_DataDictionary //AB-StoreStart // Kill find proc: Procedure Find Integer iMode Integer iIndex End_Procedure Procedure Clear Integer iFile iOpen Broadcast Recursive Send DoCheckClear Of (Parent(Self)) // Must be before Forward Send... Forward Send Clear Move 10 To iFile // From File Get_Attribute DF_FILE_OPENED Of iFile To iOpen If iOpen Close iFile Move 20 To iFile // To File Get_Attribute DF_FILE_OPENED Of iFile To iOpen If iOpen Close iFile Move 100 To iFile // From DDF File Get_Attribute DF_FILE_OPENED Of iFile To iOpen If iOpen Close iFile Move 110 To iFile // To DDF File Get_Attribute DF_FILE_OPENED Of iFile To iOpen If iOpen Close iFile End_Procedure // Clear //AB-StoreEnd End_Object // Snctable_DD Object Sncthea_DD Is A Sncthea_DataDictionary Set DDO_Server To Snctable_DD Set Constrain_File To Snctable.File_Number End_Object // Sncthea_DD Object Snctrow_DD Is A Snctrow_DataDictionary Set DDO_Server To Sncthea_DD Set Constrain_File To Sncthea.File_Number End_Object // Snctrow_DD Set Main_DD To Snctable_DD Set Server To Snctable_DD //AB-DDOEnd Object oWelcomePage Is A cWelcomePage Set piNextPage To 1 Set psWatermark To "Wizard.Bmp" Set psTitle To "Create Database Connection Wizard" Set psBottomText To "Click the Next button to continue..." //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection String sDescription Move ("Database Tables Setup records are used by the Connect program to " + ; "synchronize data in database tables of your choice.\n\n") To sDescription Move (sDescription + "You can connect data from e.g. a IBM DB2 Universal database with a " + ; "Oracle, Microsoft SQL, Pervasive, DataFlex or any other database that has an installed ODBC driver such as e.g. Microsoft Access, Sybase or Informix.\n\n" + ; "The fields/columns doesn't need to share the same names be in the same order or be of the same type, " + ; "for the two selected tables. There is also no need to make any changes to the existing database tables.\n\n") To sDescription Move (sDescription + "This Wizard will guide you through the necessary steps " + ; "to create a Database Tables Setup record.") To sDescription Set psDescription To sDescription If (iFrom = 0) ; Send Request_Clear_All Of (Main_DD(Self)) // ..._Clear_All - Just incase other DD's are addded. Set Enabled_State Of oNextButton To True End_Procedure // OnEntering //AB-StoreEnd End_Object // oWelcomePage Object oSelectDatabaseFormatPage Is A cInteriorPage Set psTitle To "Database Format Selection" Set psSubTitle To "On this page you select the Database Format for the Source and Destination Data Tables to use." Object oTable_tb Is A cTextbox //AB-StoreTopStart Set Label To ("Please select the two Database Formats where data tables are to be synchronized.\n\n" + ; "If you don't find your Database Format in the comboforms, like e.g. Microsoft Access or Informix," * ; "select 'ODBC - Open Database Connectivity' and connect to it with an installed ODBC driver.") //AB-StoreTopEnd Set Auto_Size_State To False Set Location To 50 30 Set Size To 35 314 Set Justification_Mode To jMode_Left Set TypeFace To "MS Sans Serif" //AB-StoreStart //AB-StoreEnd End_Object // oTable_tb Object oFromdb_grp Is A cRDSDbGroup Set Size To 45 315 Set Location To 105 30 Set Label To "Source Data Table" Object oSnctable_Fromdbtype Is A cDbComboformFormat Entry_Item Snctable.Fromdbtype Set Label To "Database Format:" Set Size To 13 150 Set Location To 10 67 Set Form_Border To 0 Set Label_Row_Offset To 0 Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right Set Entry_State To False Set Combo_Sort_State To False Set pbFrom To True //AB-StoreStart Procedure OnChange Forward Send OnChange Send DisableOrEnableNextPageButton End_Procedure //AB-StoreEnd End_Object // oSnctable_Fromdbtype Object oSnctable_Fromdriver Is A cDbComboformDriver Entry_Item Snctable.Fromdriver Set Label To "Database Driver:" Set Size To 13 150 Set Location To 25 67 Set Form_Border To 0 Set Label_Row_Offset To 0 Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right Set Entry_State To False Set Combo_Sort_State To False End_Object // oSnctable_Fromdriver End_Object // oFromdb_grp Object oTodb_grp Is A cRDSDbGroup Set Size To 45 315 Set Location To 155 30 Set Label To "Destination Data Table" Object oSnctable_Todbtype Is A cDbComboformFormat Entry_Item Snctable.Todbtype Set Label To "Database Format:" Set Size To 13 150 Set Location To 10 67 Set Form_Border To 0 Set Label_Row_Offset To 0 Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right Set Entry_State To False Set Combo_Sort_State To False Set pbFrom To False //AB-StoreStart Procedure OnChange Forward Send OnChange Send DisableOrEnableNextPageButton End_Procedure //AB-StoreEnd End_Object // oSnctable_Todbtype Object oSnctable_Todriver Is A cDbComboformDriver Entry_Item Snctable.Todriver Set Label To "Database Driver:" Set Size To 13 150 Set Location To 25 67 Set Form_Border To 0 Set Label_Row_Offset To 0 Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right Set Entry_State To False Set Combo_Sort_State To False End_Object // oSnctable_Todriver End_Object // oTodb_grp //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection Send DisableOrEnableNextPageButton Send Activate Of oSnctable_Fromdbtype End_Procedure // OnEntering Procedure OnLeaving Integer iTo Integer iDirection //*** Make sure we are able to use the next button on whatever page we are going to Set Enabled_State Of oNextButton To True End_Procedure // OnLeaving //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage iType Handle hoWizardPages hoNextPage hoDD Delegate Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field Snctable.FromdbType To iType //*** Determine next page Get piCurrentpage To iCurrentPage If (iType = 1) Move (iCurrentPage + 1) To iPage // DataFlex Else If (iType = 2) Move (iCurrentPage + 2) To iPage // IBM DB2 UDB Else If (iType = 3) Move (iCurrentPage + 4) To iPage // MS SQL Else If (iType = 4) Move (iCurrentPage + 6) To iPage // ODBC Else If (iType = 5) Move (iCurrentPage + 8) To iPage // Oracle Else If (iType = 6) Move (iCurrentPage + 10) To iPage // Pervasive.SQL //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Set pbFrom Of hoNextPage To True Function_Return iPage End_Function // piNextPage //*** //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if at least one method is //*** selected. Procedure DisableOrEnableNextPageButton Handle hoDD Integer iFromType iToType Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field Snctable.FromdbType To iFromType Get Field_Current_Value Of hoDD Field Snctable.TodbType To iToType Set Enabled_State Of oNextButton To (iFromType > 0 And iToType > 0) End_Procedure // DisableOrEnableNextPageButton //AB-StoreEnd End_Object // oSelectDatabaseFormatPage Object oDataFlex Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set piPreviousPage To 1 Set psTitle To "Source DataFlex Data Table Selection" Set psSubTitle To "On this page you select the DataFlex Source data table and full path." Object oPath_fm Is A cDbFormPath Entry_Item Snctable.Fromfilepath Set Label To "Table Path:" Set Size To 13 257 Set Location To 130 47 Set peAnchors To anTopLeftRight Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right Set pbFrom To True End_Object // oPath_fm Object oBrowse_bn Is A cPathButton Set Label To "&Select File" Set Size To 14 50 Set Location To 131 306 Set Status_Help To "Click to activate the Open File Dialog and select a database table. Only available for database format 'DataFlex' and 'Pervasive'" Set peAnchors To anTopRight Set Bitmap To "FolderO16.bmp" Set piTransparentColor To clWhite Set pbFrom To True //AB-StoreStart Procedure OnClick String sPath Send DoOpenFileDialog //Send DisableOrEnableNextPageButton Get Value Of oPath_fm To sPath If (Length(sPath) > 0) ; Set Enabled_State Of oNextButton To True End_Procedure // OnClick //AB-StoreEnd End_Object // oBrowse_bn Object oTable_fm Is A cDbComboformDataTable Entry_Item Snctable.Fromdatatable Set Label To "Table Name:" Set Size To 13 150 Set Location To 145 47 Set Form_Border To 0 Set Label_Row_Offset To 0 Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right Set Entry_State To False Set Combo_Sort_State To True Set pbFrom To True //AB-StoreStart //AB-StoreEnd End_Object // oTable_fm Object oViewData_bn Is A cViewDataButton Set Label To "&View Data" Set Size To 14 50 Set Location To 146 306 Set Status_Help To "View data for the selected database table." Set Bitmap To "ViewData16.bmp" Set Enabled_State To False Set piTransparentColor To clWhite Set pbFrom To True //AB-StoreStart Procedure OnClick Send DoViewData True -1 End_Procedure // OnClick //AB-StoreEnd End_Object // oViewData_bn Object oSnctable_Fromserver Is A cDbComboformServer Entry_Item Snctable.Fromserver Set Size To 13 147 Set Location To 192 47 Set Form_Border To 0 Set Label_Row_Offset To 0 Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right Set Entry_State To False Set Combo_Sort_State To True Set pbFrom To True //AB-StoreStart Set Visible_State To False Procedure OnStartUp Set Label To "" End_Procedure // OnStartUp Send OnStartUp //AB-StoreEnd End_Object // oSnctable_Fromserver Object oSnctable_Toserver Is A cDbComboformServer Entry_Item Snctable.Toserver Set Size To 13 147 Set Location To 206 47 Set Form_Border To 0 Set Label_Row_Offset To 0 Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right Set Entry_State To False Set Combo_Sort_State To True Set pbFrom To True //AB-StoreStart Set Visible_State To False Procedure OnStartUp Set Label To "" End_Procedure // OnStartUp Send OnStartUp //AB-StoreEnd End_Object // oSnctable_Toserver //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection Handle hoPath hoTable hoDD Integer iPathField iTableField String sFrom sTo sTitle sSubTitle sLabel sLabel2 sPath sTable Forward Send OnEntering iFrom iDirection Delegate Get Main_DD To hoDD Get psTitle To sTitle Get psSubTitle To sSubTitle Move (oPath_fm(Self)) To hoPath Get Label Of hoPath To sLabel Move (oTable_fm(Self)) To hoTable Get Label Of hoTable To sLabel2 If (pbFrom(Self)) Begin Move "Destination" To sFrom Move "Source" To sTo Get Field_Current_Value Of hoDD Field SncTable.FromFilePath To sPath Get Field_Current_Value Of hoDD Field SncTable.FromDataTable To sTable Field_Map SncTable.File_Number "FromFilePath" To iPathField Field_Map SncTable.File_Number "FromDataTable" To iTableField End // If (pbFrom(Self)) Begin Else Begin Move "Source" To sFrom Move "Destination" To sTo Get Field_Current_Value Of hoDD Field SncTable.ToFilePath To sPath Get Field_Current_Value Of hoDD Field SncTable.ToDataTable To sTable Field_Map SncTable.File_Number "ToFilePath" To iPathField Field_Map SncTable.File_Number "ToDataTable" To iTableField End // Else Begin // Send Ignore_Error Of Error_Info_Object 98 // Send Remove_User_Interface Of hoDD hoPath // Send Remove_User_Interface Of hoDD hoTable // Send Add_User_Interface Of hoDD hoPath // Send Add_User_Interface Of hoDD hoTable // Send Trap_Error Of Error_Info_Object 98 Set Data_Field Of hoPath Item 0 To iPathField Set Data_Field Of hoTable Item 0 To iTableField Showln "iTableField = " iTableField " iPathField = " iPathField " pbFrom = " (pbFrom(Self)) Set pbFrom Of hoPath To (pbFrom(Self)) Set pbFrom Of hoTable To (pbFrom(Self)) Set pbFrom Of oBrowse_bn To (pbFrom(Self)) Set pbFrom Of oViewData_bn To (pbFrom(Self)) Move (Replace(sFrom, sTitle, sTo)) To sTitle Move (Replace(sFrom, sSubTitle, sTo)) To sSubTitle Move (Replace(sFrom, sLabel, sTo)) To sLabel Move (Replace(sFrom, sLabel2, sTo)) To sLabel2 Set psTitle To sTitle Set psSubTitle To sSubTitle Set Label Of hoPath To sLabel Set Label Of hoTable To sLabel2 Set Label Of oSnctable_FromServer To "" Set Label Of oSnctable_ToServer To "" Set Enabled_State Of oBrowse_bn To True Send DisableOrEnableNextPageButton Send Activate Of hoTable End_Procedure // OnEntering //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage iType Handle hoWizardPages hoNextPage hoDD Get piCurrentpage To iCurrentPage If (pbFrom(Self)) Begin Delegate Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field SncTable.TodbType To iType If (iType = 1) Move iCurrentPage To iPage // DataFlex. Stay on the same tab page! Else If (iType = 2) Move (iCurrentPage + 1) To iPage // IBM DB2 UDB Else If (iType = 3) Move (iCurrentPage + 3) To iPage // MS SQL Else If (iType = 4) Move (iCurrentPage + 5) To iPage // ODBC Else If (iType = 5) Move (iCurrentPage + 7) To iPage // Oracle Else If (iType = 6) Move (iCurrentPage + 9) To iPage // Pervasive End // (pbFrom(Self)) Begin Else Begin Move (iCurrentPage + 12) To iPage End // Else Begin //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Set pbFrom Of hoNextPage To (Not(pbFrom(Self))) Function_Return iPage End_Function // piNextPage //*** //*** Function: piPreviousPage //*** Purpose : Returns the number of the previous page. Function piPreviousPage Returns Integer Integer iCurrentPage iPage iType Handle hoDD Get piCurrentpage To iCurrentPage If Not (pbFrom(Self)) Begin Delegate Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field SncTable.FromdbType To iType If (iType = 1) Begin Set pbFrom To True Move iCurrentPage To iPage // Stay on the same tab page! End // If (iType = 1) Begin End // If Not (pbFrom(Self)) Begin Else Move (iCurrentPage - 1) To iPage Forward Set piPreviousPage To iPage Function_Return iPage End_Function // piNextPage //Function ConfirmPageChange Integer iDirection Returns Integer // Function_Return True //End_Function // ConfirmPageChange //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange //Procedure OnLeaving Integer iTo Integer iDirection //End_Procedure // OnLeaving //*** //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if at least one method is //*** selected. Procedure DisableOrEnableNextPageButton Integer iRetval String sPath sTable Get Value Of oPath_fm To sPath Get Value Of oTable_fm Item 0 To sTable Get vFilePathExists (sPath - "\" - sTable) To iRetval Set Enabled_State Of oNextButton To (iRetval And sPath <> "" And sTable <> "") //Set Enabled_State Of oViewData_bn To (iRetval And sPath <> "" And sTable <> "") End_Procedure // DisableOrEnableNextPageButton On_Key Key_Alt+Key_S Send OnClick Of oBrowse_bn On_Key Key_Alt+Key_V Send OnClick Of oViewData_bn //AB-StoreEnd End_Object // oDataFlex Object oIBMDB2 Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "IBM DB2 UDB Server for the Source Table" Set psSubTitle To "On this page you select the IBM DB2 UDB Server for the Source data table" //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection Handle hoDD String sTitle sSubTitle Delegate Get Main_DD To hoDD Get psTitle To sTitle Get psSubTitle To sSubTitle If (pbFrom(Self)) Begin Move (Replace("Destination", sTitle, "Source")) To sTitle Move (Replace("Destination", sSubTitle, "Source")) To sSubTitle End // If (pbFrom(Self)) Begin Else Begin Move (Replace("Source", sTitle, "Destination")) To sTitle Move (Replace("Source", sSubTitle, "Destination")) To sSubTitle End // Else Begin Set psTitle To sTitle Set psSubTitle To sSubTitle Send DisableOrEnableNextPageButton End_Procedure // OnEntering //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage iType Handle hoWizardPages hoNextPage hoDD Get piCurrentpage To iCurrentPage Move (iCurrentPage + 1) To iPage //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Set pbFrom Of hoNextPage To (pbFrom(Self)) Function_Return iPage End_Function // piNextPage //Function ConfirmPageChange Integer iDirection Returns Integer // Function_Return True //End_Function // ConfirmPageChange //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange //Procedure OnLeaving Integer iTo Integer iDirection //End_Procedure // OnLeaving Procedure DisableOrEnableNextPageButton // Set Enabled_State Of oNextButton To ... End_Procedure // DisableOrEnableNextPageButton //AB-StoreEnd End_Object // oIBMDB2 Object oSelectIBMDB2Table Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "Select the Source Data Table to Connect to" Set psSubTitle To "On this page you select the Source data table to connect to" Object oTables_lst Is A List Set Size To 170 218 Set Location To 50 30 Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right //AB-StoreStart Function IsFillList String sName Returns Boolean String sTableName sValue Integer iTables iCount iRetval iStop Send StartWorkingMessage ("Connecting to ODBC Data Source:" * sName) Set Dynamic_Update_State To False Send Delete_Data Indicate Err False Send Ignore_Error Of Error_Info_Object 12293 ODBCEnumerateTables sName To iTables For iCount From 1 To iTables ODBCTableName iCount To sTableName Send Add_item msg_None sTableName Loop Send Sort_Items // Refind and highlight the previously selected table if user re-enters the tab-page: If (Item_Count(Self)) Begin If (pbFrom(Self)) Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromDataTable To sTableName Else Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToDataTable To sTableName Move (Trim(sTableName)) To sTableName If (Length(sTableName) > 0) Begin For iCount From 0 To (Item_Count(Self) - 1) Get Value Item iCount To sValue If (sValue = sTableName) Move 1 To iStop If iStop Break Loop If iStop Set Select_State Item iCount To True End // If (Length(sTableName) > 0) Begin Else Begin Move (Err) To iStop Send OnChange // Setting current_item to 0 does not trigger OnChange. Indicate Err as iStop // OnChange tries to open the table. Needed if the open fails. End // Else Begin End // If (Item_Count(Self)) Begin Else Move 1 To iRetval Set Dynamic_Update_State To True Send Trap_Error Of Error_Info_Object 12293 Send StopWorkingMessage Function_Return (Err + iRetval) End_Function // IsFillList Procedure OnChange String sValue Integer iItem iFile Handle hoDD If (Item_Count(Self) = 0) Procedure_Return Get Current_Item To iItem Get Value Item iItem To sValue If (Length(sValue) = 0) Procedure_Return Delegate Get Main_DD To hoDD If (pbFrom(Self)) Begin Set Field_Changed_Value Of hoDD Field SncTable.FromDataTable To sValue Set Field_Changed_Value Of hoDD Field SncTable.FromFile To 10 End Else Begin Set Field_Changed_Value Of hoDD Field SncTable.ToDataTable To sValue Set Field_Changed_Value Of hoDD Field SncTable.ToFile To 20 End Get RDSOpenAsFile hoDD (pbFrom(Self)) False To iFile End_Procedure // OnChange //AB-StoreEnd End_Object // oTables_lst Object oViewData_bn Is A Button Set Label To "&View Data" Set Location To 120 276 //AB-StoreStart Procedure OnClick Integer iFile If (pbFrom(Self)) Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromFile To iFile Else Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToFile To iFile If iFile Send DoStartViewData iFile 1 True 0 End_Procedure // OnClick //AB-StoreEnd End_Object // oViewData_bn //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection String sTitle sSubTitle Get psTitle To sTitle Get psSubTitle To sSubTitle If (pbFrom(Self)) Begin Move (Replace("Destination", sTitle, "Source")) To sTitle Move (Replace("Destination", sSubTitle, "Source")) To sSubTitle End // If (pbFrom(Self)) Begin Else Begin Move (Replace("Source", sTitle, "Destination")) To sTitle Move (Replace("Source", sSubTitle, "Destination")) To sSubTitle End // Else Begin Set psTitle To sTitle Set psSubTitle To sSubTitle If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin Send InitializeObjects Send DisableOrEnableNextPageButton End Set Enabled_State Of oNextButton To True Send Activate Of oTables_lst End_Procedure // OnEntering Procedure InitializeObjects Integer iRetval String sName Handle hoDD Delegate Get Main_DD To hoDD If (pbFrom(Self)) Get Field_Current_Value Of hoDD Field SncTable.FromServer To sName Else Get Field_Current_Value Of hoDD Field SncTable.ToServer To sName Get IsFillList Of oTables_lst sName To iRetval If iRetval Begin Send Info_Box ("Could not connect to IBM DB2 UDB Server '" + sName + "'") Send KeyAction Of oBackButton End // If iRetval Begin End_Procedure // InitializeObjects //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage iType Handle hoWizardPages hoNextPage hoDD Boolean bFrom Get piCurrentpage To iCurrentPage If (pbFrom(Self)) Begin Move (Not(pbFrom(Self))) To bFrom Delegate Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field SncTable.TodbType To iType If (iType = 1) Move (iCurrentPage - 2) To iPage // DataFlex. Else If (iType = 2) Move (iCurrentPage - 1) To iPage // IBM DB2 UDB Else If (iType = 3) Move (iCurrentPage + 1) To iPage // MS SQL Else If (iType = 4) Move (iCurrentPage + 3) To iPage // ODBC Else If (iType = 5) Move (iCurrentPage + 5) To iPage // Oracle Else If (iType = 6) Move (iCurrentPage + 7) To iPage // Pervasive End // (pbFrom(Self)) Begin Else Begin Move (pbFrom(Self)) To bFrom Move (iCurrentPage + 9) To iPage End // Else Begin //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Set pbFrom Of hoNextPage To bFrom Function_Return iPage End_Function // piNextPage //Function ConfirmPageChange Integer iDirection Returns Integer // Function_Return True //End_Function // ConfirmPageChange //Procedure OnEntering Integer iFrom Integer iDirection //End_Procedure // OnEntering //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange //Procedure OnLeaving Integer iTo Integer iDirection //End_Procedure // OnLeaving Procedure DisableOrEnableNextPageButton // Set Enabled_State Of oNextButton To ... End_Procedure // DisableOrEnableNextPageButton //AB-StoreEnd End_Object // oSelectIBMDB2Table Object oMSSQL Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "Microsoft SQL Server for the Source Table" Set psSubTitle To "On this page you select the Microsoft SQL Server for the Source data table" //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection Handle hoDD String sTitle sSubTitle Delegate Get Main_DD To hoDD Get psTitle To sTitle Get psSubTitle To sSubTitle If (pbFrom(Self)) Begin Move (Replace("Destination", sTitle, "Source")) To sTitle Move (Replace("Destination", sSubTitle, "Source")) To sSubTitle End // If (pbFrom(Self)) Begin Else Begin Move (Replace("Source", sTitle, "Destination")) To sTitle Move (Replace("Source", sSubTitle, "Destination")) To sSubTitle End // Else Begin Set psTitle To sTitle Set psSubTitle To sSubTitle Send DisableOrEnableNextPageButton End_Procedure // OnEntering //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage iType Handle hoWizardPages hoNextPage hoDD Get piCurrentpage To iCurrentPage Move (iCurrentPage + 1) To iPage //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Set pbFrom Of hoNextPage To (pbFrom(Self)) Function_Return iPage End_Function // piNextPage //Function ConfirmPageChange Integer iDirection Returns Integer // Function_Return True //End_Function // ConfirmPageChange //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange //Procedure OnLeaving Integer iTo Integer iDirection //End_Procedure // OnLeaving Procedure DisableOrEnableNextPageButton // Set Enabled_State Of oNextButton To ... End_Procedure // DisableOrEnableNextPageButton //AB-StoreEnd End_Object // oMSSQL Object oSelectMSSQLTable Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "Select the Source Data Table to Connect to" Set psSubTitle To "On this page you select the Source data table to connect to" Object oTables_lst Is A List Set Size To 170 218 Set Location To 50 30 Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right //AB-StoreStart Function IsFillList String sName Returns Boolean String sTableName sValue Integer iTables iCount iRetval iStop Send StartWorkingMessage ("Connecting to ODBC Data Source:" * sName) Set Dynamic_Update_State To False Send Delete_Data Indicate Err False Send Ignore_Error Of Error_Info_Object 12293 ODBCEnumerateTables sName To iTables For iCount From 1 To iTables ODBCTableName iCount To sTableName Send Add_item msg_None sTableName Loop Send Sort_Items // Refind and highlight a previously selected table if user re-enters the tab-page: If (Item_Count(Self)) Begin If (pbFrom(Self)) Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromDataTable To sTableName Else Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToDataTable To sTableName Move (Trim(sTableName)) To sTableName If (Length(sTableName) > 0) Begin For iCount From 0 To (Item_Count(Self) - 1) Get Value Item iCount To sValue If (sValue = sTableName) Move 1 To iStop If iStop Break Loop If iStop Set Select_State Item iCount To True End // If (Length(sTableName) > 0) Begin Else Begin Move (Err) To iStop Send OnChange // Setting current_item to 0 does not trigger OnChange. Indicate Err as iStop // OnChange tries to open the table. Needed if the open fails. End // Else Begin End // If (Item_Count(Self)) Begin Else Move 1 To iRetval Set Dynamic_Update_State To True Send Trap_Error Of Error_Info_Object 12293 Send StopWorkingMessage Function_Return (Err + iRetval) End_Function // IsFillList Procedure OnChange String sValue Integer iFile iItem Handle hoDD If (Item_Count(Self) = 0) Procedure_Return Get Current_Item To iItem Get Value Item iItem To sValue If (Length(sValue) = 0) Procedure_Return Delegate Get Main_DD To hoDD If (pbFrom(Self)) Begin Set Field_Changed_Value Of hoDD Field SncTable.FromDataTable To sValue Set Field_Changed_Value Of hoDD Field SncTable.FromFile To 10 End Else Begin Set Field_Changed_Value Of hoDD Field SncTable.ToDataTable To sValue Set Field_Changed_Value Of hoDD Field SncTable.ToFile To 20 End Get RDSOpenAsFile hoDD (pbFrom(Self)) False To iFile End_Procedure // OnChange //AB-StoreEnd End_Object // oTables_lst Object oViewData_bn Is A Button Set Label To "&View Data" Set Location To 120 276 //AB-StoreStart Procedure OnClick Integer iFile If (pbFrom(Self)) Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromFile To iFile Else Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToFile To iFile If iFile Send DoStartViewData iFile 1 True 0 End_Procedure // OnClick //AB-StoreEnd End_Object // oViewData_bn //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection String sTitle sSubTitle Get psTitle To sTitle Get psSubTitle To sSubTitle If (pbFrom(Self)) Begin Move (Replace("Destination", sTitle, "Source")) To sTitle Move (Replace("Destination", sSubTitle, "Source")) To sSubTitle End // If (pbFrom(Self)) Begin Else Begin Move (Replace("Source", sTitle, "Destination")) To sTitle Move (Replace("Source", sSubTitle, "Destination")) To sSubTitle End // Else Begin Set psTitle To sTitle Set psSubTitle To sSubTitle If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin Send InitializeObjects Send DisableOrEnableNextPageButton End Set Enabled_State Of oNextButton To True Send Activate Of oTables_lst End_Procedure // OnEntering Procedure InitializeObjects Integer iRetval String sName Handle hoDD Delegate Get Main_DD To hoDD If (pbFrom(Self)) Get Field_Current_Value Of hoDD Field SncTable.FromServer To sName Else Get Field_Current_Value Of hoDD Field SncTable.ToServer To sName Get IsFillList Of oTables_lst sName To iRetval If iRetval Begin Send Info_Box ("Could not connect to Microsoft SQL Server '" + sName + "'") Send KeyAction Of oBackButton End // If iRetval Begin End_Procedure // InitializeObjects //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage iType Handle hoWizardPages hoNextPage hoDD Boolean bFrom Get piCurrentpage To iCurrentPage If (pbFrom(Self)) Begin Move (Not(pbFrom(Self))) To bFrom Delegate Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field SncTable.TodbType To iType If (iType = 1) Move (iCurrentPage - 4) To iPage // DataFlex. Else If (iType = 2) Move (iCurrentPage - 3) To iPage // IBM DB2 UDB Else If (iType = 3) Move (iCurrentPage - 1) To iPage // MS SQL Else If (iType = 4) Move (iCurrentPage + 1) To iPage // ODBC Else If (iType = 5) Move (iCurrentPage + 3) To iPage // Oracle Else If (iType = 6) Move (iCurrentPage + 5) To iPage // Pervasive End // (pbFrom(Self)) Begin Else Begin Move (pbFrom(Self)) To bFrom Move (iCurrentPage + 7) To iPage End // Else Begin //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Set pbFrom Of hoNextPage To bFrom Function_Return iPage End_Function // piNextPage //Function ConfirmPageChange Integer iDirection Returns Integer // Function_Return True //End_Function // ConfirmPageChange //Procedure OnEntering Integer iFrom Integer iDirection //End_Procedure // OnEntering //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange //Procedure OnLeaving Integer iTo Integer iDirection //End_Procedure // OnLeaving Procedure DisableOrEnableNextPageButton // Set Enabled_State Of oNextButton To ... End_Procedure // DisableOrEnableNextPageButton //AB-StoreEnd End_Object // oSelectMSSQLTable Object oODBC Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "ODBC Data Source Name for the Source Table" Set psSubTitle To "On this page you select the ODBC Data Source Name for the Source data table" Object oTable_tb Is A cTextbox //AB-StoreTopStart Set Label To ("Please select the ODBC Data Source Type and it's Name or File for the Source data table." * ; "If you need to create a new or edit an ODBC Data Source Name press the 'ODBC Admin' button.") //AB-StoreTopEnd Set Auto_Size_State To False Set Location To 44 30 Set Size To 17 314 Set Justification_Mode To jMode_Left Set TypeFace To "MS Sans Serif" //AB-StoreStart //AB-StoreEnd End_Object // oTable_tb Object oDSN_lst Is A Grid Set CurrentCellColor To clHighlight Set CurrentRowColor To clHighlight Set CurrentRowTextColor To clWindow Set Size To 92 225 Set Location To 65 30 Set Highlight_Row_state To True Set GridLine_Mode To GRID_VISIBLE_NONE Set Line_Width To 2 0 Set Form_Width Item 0 To 100 Set Header_Label Item 0 To "Name" Set Form_Width Item 1 To 120 Set Header_Label Item 1 To "Driver" //AB-StoreStart Set Select_Mode To Auto_Select Object oDSNArray Is An Array // Sort array. End_Object // oDSNArray Procedure FillDSNList Integer iType Handle ho String sDSNName sDriver Integer iNumDSN iCount Set Dynamic_Update_State To False Move (oDSNArray(Self)) To ho Send Delete_Data Of ho Send Delete_Data If (iType = 2) Procedure_Return ODBCEnumerateDataSources iNumDSN iType // First put all items in an array.... For iCount From 1 To iNumDSN ODBCDSNName iCount To sDSNName Set Array_Value Of ho Item (Item_Count(ho)) To sDSNName Loop // ...and sort items... Send Sort_Items Of ho // ...and display array items in the list object, together with // the driver name. For iCount From 0 To (iNumDSN - 1) Get String_Value Of ho Item iCount To sDSNName Send Add_Item msg_None sDSNName Set Entry_State Item (Item_Count(Self) - 1) To False Set Aux_Value Item (Item_Count(Self) - 1) To 1 If (iType = 0) Begin Set_Registry_Root To HKEY_CURRENT_USER 'Software' Get_Foreign_Profile_String "ODBC" "ODBC.INI\ODBC Data Sources" sDSNName To sDriver End // If (iType = 0) Begin If (iType = 1) Begin Set_Registry_Root To HKEY_LOCAL_MACHINE 'Software' Get_Foreign_Profile_String "ODBC" "ODBC.INI\ODBC Data Sources" sDSNName To sDriver End // If (iType = 1) Begin Send Add_Item msg_None sDriver Set Entry_State Item (Item_Count(Self) - 1) To False Loop Set_Registry_Root To HKEY_LOCAL_MACHINE 'Software' Set Dynamic_Update_State To True End_Procedure // FillDSNList Procedure Select_Toggling Integer iItem Integer bState String sValue Integer iCurrent iAux Forward Send Select_Toggling iItem bState If Not (Enabled_State(Self)) Procedure_Return If (Item_Count(Self) < 2) Procedure_Return Move iItem To iCurrent Get Aux_Value Item iItem To iAux If Not iAux Decrement iCurrent Get Value Item iCurrent To sValue Move ("DSN=" + sValue) To sValue If (Length(sValue) > 150) Begin Send Info_Box "Sorry, the length of a Data Source Name has been exceeded. Max length is 146." Procedure_Return End // If (Length(sFile) > 100) Begin If (pbFrom(Self)) Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.FromServer To sValue Else Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.ToServer To sValue End_Procedure // Select_Toggling On_Key kNext_Item Send Switch // Rotate out of grid with the tab-key. //AB-StoreEnd End_Object // oDSN_lst Object oFileDSN_bn Is A Button Set Label To "&Select File" Set Location To 93 261 Set Status_Help To "Button is only enabled when the 'File Data Sources' radio button has been selected" //AB-StoreStart Procedure OnClick String sFile sStartDir Boolean bSelected Handle ho Get_Foreign_Profile_String "ODBC" "ODBC.INI\ODBC File DSN" "DefaultDSNDir" To sStartDir Object oDialog Is An Opendialog Set Dialog_Caption To 'Select a file data source' Set Filter_String To "Data Sources (*.dsn)|*.dsn|All files (*.*)|*.*" Set PathMustExist_State To True Set FilemustExist_State To True Set NoChangeDir_State To True Set HideReadOnly_State To True If (sStartDir <> "" ) ; Set Initial_Folder To sStartDir Move Self To ho End_Object // oDialog Get Show_Dialog Of ho To bSelected If bSelected Get File_Name Of ho To sFile Send Destroy Of ho If (bSelected And (Length(sFile) > 0)) Begin Move ("FILEDSN=" + sFile) To sFile If (Length(sFile) > 150) Begin Send Info_Box "Sorry, the length of the path and file name for the Data Source Name has been exceeded. Max length is 142." Procedure_Return End // If (Length(sFile) > 100) Begin If (pbFrom(Self)) Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.FromServer To sFile Else Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.ToServer To sFile Set Enabled_State Of oNextButton To True Send KeyAction Of oNextButton End // If (bSelected and (Length(sFile) > 0)) Begin Else Begin If (pbFrom(Self)) Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.FromServer To "" Else Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.ToServer To "" Set Enabled_State Of oNextButton To False End // Else Begin End_Procedure // OnClick //AB-StoreEnd End_Object // oFileDSN_bn Object oODBCAdmin_bn Is A Button Set Label To "ODBC &Admin" Set Location To 122 261 Set Status_Help To "Start Windows 'ODBC Data Source Administrator'" //AB-StoreStart Procedure OnClick Handle hWnd Integer iRadio Get Window_Handle Of oConnectDbWizard To hWnd ODBCManager hWnd Get Current_Radio Of oDSN_grp To iRadio Send FillDSNList Of oDSN_lst iRadio End_Procedure // OnClick //AB-StoreEnd End_Object // oODBCAdmin_bn Object oDSN_grp Is A RadioGroup Set Size To 58 283 Set Location To 165 30 Set Label To "Select Data Source Type" Object Radio4 Is A Radio Set Label To "&User Data Sources" Set Size To 10 77 Set Location To 10 5 End_Object // Radio4 Object Radio5 Is A Radio Set Label To "Syste&m Data Sources" Set Size To 10 85 Set Location To 10 91 End_Object // Radio5 Object Radio6 Is A Radio Set Label To "&File Data Sources" Set Size To 10 73 Set Location To 10 182 Set Status_Help To "Press the 'Select File' button to select a Data Source" End_Object // Radio6 Object oODBCBitmap_bn Is A cBitmapButton Set Size To 24 25 Set Location To 28 6 Set Bitmap To "ODBC32.bmp" Set piTransparentColor To clFuchsia //AB-StoreStart //Set pbFlat Of (phoToolBar(Self)) To True Procedure OnClick Send KeyAction Of oODBCAdmin_bn End_Procedure // OnClick //AB-StoreEnd End_Object // oODBCBitmap_bn Object oText Is A Textbox Set Auto_Size_State To False Set Location To 28 38 Set Size To 28 232 Set Justification_Mode To jMode_Left Set TypeFace To "MS Sans Serif" End_Object // oText //AB-StoreStart Procedure Notify_Select_State Integer iToItem Integer iFromItem Handle ho Move (oText(Self)) To ho If (iToItem = 2) Begin Set Color Of (oDSN_lst(Self)) To clBtnFace Set Enabled_State Of (oFileDSN_bn(Self)) To True Set Enabled_State Of (oDSN_lst(Self)) To False Set Default_State Of (oFileDSN_bn(Self)) To True Set Enabled_State Of oNextButton To False Set Value Of ho Item 0 To ; ("An ODBC File data source allows you to connect to a data provider. File" * ; "DSNs can be shared by users who have the same drivers installed. NOTE:" * ; "You can now press the 'Select File' button.") End // If (iToItem = 2) Begin Else Begin Set Color Of (oDSN_lst(Self)) To clWindow Set Enabled_State Of (oDSN_lst(Self)) To True Set Enabled_State Of (oFileDSN_bn(Self)) To False Set Enabled_State Of oNextButton To True End // Else Begin If (iToItem = 0) Set Value Of ho Item 0 To ; ("An ODBC User data source stores information about how to connect to" * ; "the indicated data provider. A User data source is only visible to you," * ; "and can only be used on the current machine.") If (iToItem = 1) Set Value Of ho Item 0 To ; ("An ODBC System data source stores information about how to connect to" * ; "the indicated data provider. A System data source is visible to all users" * ; "on this machine, including NT services.") Send FillDSNList Of oDSN_lst iToItem End_Procedure // Notify_Select_State //AB-StoreEnd End_Object // oDSN_grp //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection Handle ho String sTitle sSubTitle sText sValue Get psTitle To sTitle Get psSubTitle To sSubTitle Move (oTable_tb(Self)) To ho Get Value Of ho To sText If (pbFrom(Self)) Begin Move (Replace("Destination", sTitle, "Source")) To sTitle Move (Replace("Destination", sSubTitle, "Source")) To sSubTitle Move (Replace("Destination", sText, "Source")) To sText Set psTitle To sTitle Set psSubTitle To sSubTitle Set Value Of ho To sText End // (pbFrom(Self)) Begin Else Begin Move (Replace("Source", sTitle, "Destination")) To sTitle Move (Replace("Source", sSubTitle, "Destination")) To sSubTitle Move (Replace("Source", sText, "Destination")) To sText Set psTitle To sTitle Set psSubTitle To sSubTitle Set Value Of ho To sText End // Else Begin //*** Fill the list if we are entering this in forward direction If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin Send DisableOrEnableNextPageButton End Send Activate Of oDSN_lst // This must be placed here after the object is activated: If (pbFrom(Self)) Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromServer To sValue Else Set Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToServer To sValue If (Length(sValue) = 0) Send Select_Toggling Of oDSN_lst 0 1 End_Procedure // OnEntering //*** Make sure we are able to use the next button on whatever page we are going to. Procedure OnLeaving Integer iTo Integer iDirection Set Enabled_State Of oNextButton To True If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin End // If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin End_Procedure // OnLeaving //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage Handle hoWizardPages hoNextPage Get piCurrentpage To iCurrentPage Move (iCurrentPage + 1) To iPage Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Set pbFrom Of hoNextPage To (pbFrom(Self)) Function_Return iPage End_Function // piNextPage //*** //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if at least one method is //*** selected. Procedure DisableOrEnableNextPageButton End_Procedure // DisableOrEnableNextPageButton Procedure ToggleRadio0 Handle ho Integer iRadio Move (oDSN_grp(Self)) To ho Get Current_Radio Of ho To iRadio Set Current_Radio Of ho To 0 End_Procedure // ToggleRadio0 Procedure ToggleRadio1 Handle ho Integer iRadio Move (oDSN_grp(Self)) To ho Get Current_Radio Of ho To iRadio Set Current_Radio Of ho To 1 End_Procedure // ToggleRadio1 Procedure ToggleRadio2 Handle ho Integer iRadio Move (oDSN_grp(Self)) To ho Get Current_Radio Of ho To iRadio Set Current_Radio Of ho To 2 End_Procedure // ToggleRadio2 On_Key Key_Alt+Key_S Send KeyAction Of oFileDSN_bn On_Key Key_Alt+Key_A Send KeyAction Of oODBCAdmin_bn On_Key Key_Alt+Key_U Send ToggleRadio0 On_Key Key_Alt+Key_M Send ToggleRadio1 On_Key Key_Alt+Key_F Send ToggleRadio2 //AB-StoreEnd End_Object // oODBC Object oSelectODBCTable Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "Select the Source Data Table to Connect to" Set psSubTitle To "On this page you select the Source data table to connect to" Object oTables_lst Is A List Set Size To 170 218 Set Location To 50 30 Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right //AB-StoreStart Function IsFillList String sName Returns Boolean String sTableName sValue Integer iTables iCount iRetval iStop Send StartWorkingMessage ("Connecting to ODBC Data Source:" * sName) Set Dynamic_Update_State To False Send Delete_Data Indicate Err False Send Ignore_Error Of Error_Info_Object 12293 ODBCEnumerateTables sName To iTables For iCount From 1 To iTables ODBCTableName iCount To sTableName Send Add_item msg_None sTableName Loop Send Sort_Items // Refind and highlight a previously selected table if user re-enters the tab-page: If (Item_Count(Self)) Begin If (pbFrom(Self)) Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromDataTable To sTableName Else Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToDataTable To sTableName Move (Trim(sTableName)) To sTableName If (Length(sTableName) > 0) Begin For iCount From 0 To (Item_Count(Self) - 1) Get Value Item iCount To sValue If (sValue = sTableName) Move 1 To iStop If iStop Break Loop If iStop Set Select_State Item iCount To True End // If (Length(sTableName) > 0) Begin Else Begin Move (Err) To iStop Send OnChange // Setting current_item to 0 does not trigger OnChange. Indicate Err as iStop // OnChange tries to open the table. Needed if the open fails. End // Else Begin End // If (Item_Count(Self)) Begin Else Move 1 To iRetval Set Dynamic_Update_State To True Send Trap_Error Of Error_Info_Object 12293 Send StopWorkingMessage Function_Return (Err + iRetval) End_Function // IsFillList Procedure OnChange String sValue Integer iFile iItem Handle hoDD If (Item_Count(Self) = 0) Procedure_Return Get Current_Item To iItem Get Value Item iItem To sValue If (Length(sValue) = 0) Procedure_Return Delegate Get Main_DD To hoDD If (pbFrom(Self)) Begin Set Field_Changed_Value Of hoDD Field SncTable.FromDataTable To sValue Set Field_Changed_Value Of hoDD Field SncTable.FromFile To 10 End Else Begin Set Field_Changed_Value Of hoDD Field SncTable.ToDataTable To sValue Set Field_Changed_Value Of hoDD Field SncTable.ToFile To 20 End Get RDSOpenAsFile hoDD (pbFrom(Self)) False To iFile End_Procedure // OnChange //AB-StoreEnd End_Object // oTables_lst Object oViewData_bn Is A Button Set Label To "&View Data" Set Location To 120 276 //AB-StoreStart Procedure OnClick Integer iFile If (pbFrom(Self)) Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromFile To iFile Else Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToFile To iFile If iFile Send DoStartViewData iFile 1 True 0 End_Procedure // OnClick //AB-StoreEnd End_Object // oViewData_bn //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection String sSubTitle Get psSubTitle To sSubTitle If (pbFrom(Self)) Begin Move (Replace("Destination", sSubTitle, "Source")) To sSubTitle Set psSubTitle To sSubTitle End // If (pbFrom(Self)) Begin Else Begin Move (Replace("Source", sSubTitle, "Destination")) To sSubTitle Set psSubTitle To sSubTitle End // Else Begin If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin Send InitializeObjects Send DisableOrEnableNextPageButton End Set Enabled_State Of oNextButton To True Send Activate Of oTables_lst End_Procedure // OnEntering Procedure InitializeObjects Integer iRetval iPos String sName sPrefix Handle hoDD Delegate Get Main_DD To hoDD If (pbFrom(Self)) Get Field_Current_Value Of hoDD Field SncTable.FromServer To sName Else Get Field_Current_Value Of hoDD Field SncTable.ToServer To sName Move (Pos("=", sName)) To iPos If iPos Begin Move (Left(sName, iPos)) To sPrefix Move (Replace(sPrefix, sName, "")) To sName If (sPrefix = "FILEDSN=") Move (sPrefix + sName) To sName End // If iPos Begin Get IsFillList Of oTables_lst sName To iRetval If Not iRetval Begin If (sPrefix = "DSN=") ; Set psTitle To ("Select the '" * sName * "' Data Table to Connect to") Else ; Set psTitle To ("Select the 'File Data Source' Data Table to Connect to") End // If Not iRetval Begin Else Begin Send Info_Box ("Could not connect to ODBC Data Source Name '" + sName + "'") Send KeyAction Of oBackButton End // Else Begin End_Procedure // InitializeObjects //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange Procedure OnLeaving Integer iTo Integer iDirection If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin End // If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin Set Enabled_State Of oNextButton To True End_Procedure // OnLeaving //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage iType Handle hoWizardPages hoNextPage hoDD Boolean bFrom Get piCurrentpage To iCurrentPage If (pbFrom(Self)) Begin Move (Not(pbFrom(Self))) To bFrom Delegate Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field SncTable.TodbType To iType If (iType = 1) Move (iCurrentPage - 6) To iPage // DataFlex. Else If (iType = 2) Move (iCurrentPage - 4) To iPage // IBM DB2 UDB Else If (iType = 3) Move (iCurrentPage - 2) To iPage // MS SQL Else If (iType = 4) Move (iCurrentPage - 1) To iPage // ODBC Else If (iType = 5) Move (iCurrentPage + 1) To iPage // Oracle Else If (iType = 6) Move (iCurrentPage + 3) To iPage // Pervasive End // (pbFrom(Self)) Begin Else Begin Move (pbFrom(Self)) To bFrom Move (iCurrentPage + 5) To iPage End // Else Begin //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Set pbFrom Of hoNextPage To bFrom Function_Return iPage End_Function // piNextPage //*** //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if at least one method is //*** selected. Procedure DisableOrEnableNextPageButton End_Procedure // DisableOrEnableNextPageButton On_Key Key_Alt+Key_V Send KeyAction Of oViewData_bn //AB-StoreEnd End_Object // oSelectODBCTable Object oOracle Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "Oracle Server for the Source Table" Set psSubTitle To "On this page you select the Oracle Server for the Source data table" //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection Handle hoDD String sTitle sSubTitle Delegate Get Main_DD To hoDD Get psTitle To sTitle Get psSubTitle To sSubTitle If (pbFrom(Self)) Begin Move (Replace("Destination", sTitle, "Source")) To sTitle Move (Replace("Destination", sSubTitle, "Source")) To sSubTitle End // If (pbFrom(Self)) Begin Else Begin Move (Replace("Source", sTitle, "Destination")) To sTitle Move (Replace("Source", sSubTitle, "Destination")) To sSubTitle End // Else Begin Set psTitle To sTitle Set psSubTitle To sSubTitle Send DisableOrEnableNextPageButton End_Procedure // OnEntering //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage iType Handle hoWizardPages hoNextPage hoDD Get piCurrentpage To iCurrentPage Move (iCurrentPage + 1) To iPage //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Set pbFrom Of hoNextPage To (pbFrom(Self)) Function_Return iPage End_Function // piNextPage //Function ConfirmPageChange Integer iDirection Returns Integer // Function_Return True //End_Function // ConfirmPageChange //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange //Procedure OnLeaving Integer iTo Integer iDirection //End_Procedure // OnLeaving Procedure DisableOrEnableNextPageButton // Set Enabled_State Of oNextButton To ... End_Procedure // DisableOrEnableNextPageButton //AB-StoreEnd End_Object // oOracle Object oSelectOracleTable Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "Select the Source Data Table to Connect to" Set psSubTitle To "On this page you select the Source data table to connect to" Object oTables_lst Is A List Set Size To 170 218 Set Location To 50 30 Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right //AB-StoreStart Function IsFillList String sName Returns Boolean String sTableName sValue Integer iTables iCount iRetval iStop Send StartWorkingMessage ("Connecting to ODBC Data Source:" * sName) Set Dynamic_Update_State To False Send Delete_Data Indicate Err False Send Ignore_Error Of Error_Info_Object 12293 ODBCEnumerateTables sName To iTables For iCount From 1 To iTables ODBCTableName iCount To sTableName Send Add_item msg_None sTableName Loop Send Sort_Items // Refind and highlight a previously selected table if user re-enters the tab-page: If (Item_Count(Self)) Begin If (pbFrom(Self)) Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromDataTable To sTableName Else Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToDataTable To sTableName Move (Trim(sTableName)) To sTableName If (Length(sTableName) > 0) Begin For iCount From 0 To (Item_Count(Self) - 1) Get Value Item iCount To sValue If (sValue = sTableName) Move 1 To iStop If iStop Break Loop If iStop Set Select_State Item iCount To True End // If (Length(sTableName) > 0) Begin Else Begin Move (Err) To iStop Send OnChange // Setting current_item to 0 does not trigger OnChange. Indicate Err as iStop // OnChange tries to open the table. Needed if the open fails. End // Else Begin End // If (Item_Count(Self)) Begin Else Move 1 To iRetval Set Dynamic_Update_State To True Send Trap_Error Of Error_Info_Object 12293 Send StopWorkingMessage Function_Return (Err + iRetval) End_Function // IsFillList Procedure OnChange String sValue Integer iFile iItem Handle hoDD If (Item_Count(Self) = 0) Procedure_Return Get Current_Item To iItem Get Value Item iItem To sValue If (Length(sValue) = 0) Procedure_Return Delegate Get Main_DD To hoDD If (pbFrom(Self)) Begin Set Field_Changed_Value Of hoDD Field SncTable.FromDataTable To sValue Set Field_Changed_Value Of hoDD Field SncTable.FromFile To 10 End Else Begin Set Field_Changed_Value Of hoDD Field SncTable.ToDataTable To sValue Set Field_Changed_Value Of hoDD Field SncTable.ToFile To 20 End Get RDSOpenAsFile hoDD (pbFrom(Self)) False To iFile End_Procedure // OnChange //AB-StoreEnd End_Object // oTables_lst Object oViewData_bn Is A Button Set Label To "&View Data" Set Location To 120 276 //AB-StoreStart Procedure OnClick Integer iFile If (pbFrom(Self)) Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromFile To iFile Else Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToFile To iFile If iFile Send DoStartViewData iFile 1 True 0 End_Procedure // OnClick //AB-StoreEnd End_Object // oViewData_bn //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection String sSubTitle Get psSubTitle To sSubTitle If (pbFrom(Self)) Begin Move (Replace("Destination", sSubTitle, "Source")) To sSubTitle Set psSubTitle To sSubTitle End // If (pbFrom(Self)) Begin Else Begin Move (Replace("Source", sSubTitle, "Destination")) To sSubTitle Set psSubTitle To sSubTitle End // Else Begin If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin Send InitializeObjects Send DisableOrEnableNextPageButton End Set Enabled_State Of oNextButton To True Send Activate Of oTables_lst End_Procedure // OnEntering Procedure InitializeObjects Integer iRetval String sName Handle hoDD Delegate Get Main_DD To hoDD If (pbFrom(Self)) Get Field_Current_Value Of hoDD Field SncTable.FromServer To sName Else Get Field_Current_Value Of hoDD Field SncTable.ToServer To sName Get IsFillList Of oTables_lst sName To iRetval If iRetval Begin Send Info_Box ("Could not connect to Oracle Server '" + sName + "'") Send KeyAction Of oBackButton End // If iRetval Begin End_Procedure // InitializeObjects //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange Procedure OnLeaving Integer iTo Integer iDirection Handle ho hoDD Integer iCurrent String sTable sSchema If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin // Move (oTables_lst(Self)) To ho // Delegate Get Main_DD To hoDD // Get Current_Item Of ho To iCurrent // Get Value Of ho item iCurrent To sTable // If (pbFrom(Self)) Set Field_Changed_Value Of hoDD Field SncTable.FromDataTable To sTable // Else Set Field_Changed_Value Of hoDD Field SncTable.ToDataTable To sTable End // If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin Set Enabled_State Of oNextButton To True End_Procedure // OnLeaving //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage iType Handle hoWizardPages hoNextPage hoDD Boolean bFrom Get piCurrentpage To iCurrentPage If (pbFrom(Self)) Begin Move (Not(pbFrom(Self))) To bFrom Delegate Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field SncTable.TodbType To iType If (iType = 1) Move (iCurrentPage - 8) To iPage // DataFlex. Else If (iType = 2) Move (iCurrentPage - 7) To iPage // IBM DB2 UDB Else If (iType = 3) Move (iCurrentPage - 5) To iPage // MS SQL Else If (iType = 4) Move (iCurrentPage - 3) To iPage // ODBC Else If (iType = 5) Move (iCurrentPage - 1) To iPage // Oracle Else If (iType = 6) Move (iCurrentPage + 1) To iPage // Pervasive End // (pbFrom(Self)) Begin Else Begin Move (pbFrom(Self)) To bFrom Move (iCurrentPage + 3) To iPage End // Else Begin //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Set pbFrom Of hoNextPage To bFrom Function_Return iPage End_Function // piNextPage //*** //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if at least one method is //*** selected. Procedure DisableOrEnableNextPageButton End_Procedure // DisableOrEnableNextPageButton //AB-StoreEnd End_Object // oSelectOracleTable Object oPervasive Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True Property String psFromDDFFile "" Property String psToDDFFile "" //AB-StoreTopEnd Set piPreviousPage To 1 Set psTitle To "Source Data Table Selection" Set psSubTitle To "On this page you select the Pervasive Source File.ddf table and full path" Object oInfo_tb Is A cTextbox Set Auto_Size_State To False Set Location To 44 30 Set Size To 48 314 Set Justification_Mode To jMode_Left Set TypeFace To "MS Sans Serif" //AB-StoreStart Set Label To ("Pervasive/Btrieve DDF's (Data Dictionary Files) are meta data files that contains all information about" * ; "the data tables, indeces and fields that belongs to a Pervasive database.\n\n" + ; "If you can't find a set of .DDF files (File.ddf, Index.ddf and Fields.ddf) you need to" * ; "use the 'Pervasive Control Center' utility to create them first.") //AB-StoreEnd End_Object // oInfo_tb Object oOpenDialog Is A OpenDialog //AB/ Set Location to 97 315 Set Dialog_Caption To "Select a Pervasive Data Definition File (File.ddf)" Set Filter_String To "Pervasive Data Definition File (File.ddf)|File.ddf|" //AB-StoreStart Procedure DoCallOpenDialog Integer iVoid String sValue sPath sTable Handle ho ho2 hoDD Move (oPath_fm(Self)) To ho Move (oTable_fm(Self)) To ho2 Delegate Get Main_DD To hoDD // Panel property If (pbFrom(Self)) ; Get Field_Current_Value Of hoDD Field SncTable.FromFilePath To sPath Else Begin Get Field_Current_Value Of hoDD Field SncTable.ToFilePath To sPath If (Length(sPath) = 0) ; Get Field_Current_Value Of hoDD Field SncTable.FromFilePath To sPath End // Else Begin Set Initial_Folder To sValue Get Show_Dialog To iVoid If iVoid Begin Get File_Name To sValue Get StripFile sValue To sPath Get StripPath sValue To sTable Set Value Of ho To sPath Set Value Of ho2 To sTable End // If iVoid Begin End_Procedure // DoCallOpenDialog //AB-StoreEnd End_Object // oOpenDialog Object oPath_fm Is A Form Set Label To "Source DDF Meta File Path:" Set Size To 13 203 Set Location To 130 96 Set Status_Help To "Press F4 or Alt+B to popup the Open File Dialog." Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right //AB-StoreStart Set Enabled_State To False Procedure OnChange Send DisableOrEnableNextPageButton End_Procedure // OnChange //AB-StoreEnd End_Object // oPath_fm Object oBrowse_bn Is A Button Set Label To "&Browse" Set Location To 130 302 //AB-StoreStart Procedure OnClick Integer iFile iOpen Handle hoDD String sPath sTable sDriver If (pbFrom(Self)) Begin Delegate Get piFromDDFFile To iFile // Panel property. Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromDriver To sDriver End // If bFrom Begin Else Begin Delegate Get piToDDFFile To iFile // Panel property Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToDriver To sDriver End // Else Begin If (iFile = 0) Begin Send Info_Box "Program error.\npiFromDDFFile or piToDDFFile not set. Cannot open Pervasive Meta data file: 'File.DDF'." Procedure_Return End // If (iFile = 0) Begin Get_Attribute DF_FILE_OPENED Of iFile To iOpen If iOpen Close iFile Send DoCallOpenDialog Of oOpenDialog Delegate Get Main_DD To hoDD Get Value Of oPath_fm To sPath Get Value Of oTable_fm To sTable If (Length(sTable) = 0) Procedure_Return If (pbFrom(Self)) Begin Delegate Set psFromDDFFile To sTable // Tab page property. Set Field_Changed_Value Of hoDD Field SncTable.FromFilePath To sPath // Do we need to have a field for the "File.ddf" file name??? End // If (pbFrom(Self)) Begin Else Begin Delegate Set psToDDFFile To sTable // Tab page property. Set Field_Changed_Value Of hoDD Field SncTable.ToFilePath To sPath // Do we need to have a field for the "File.ddf" file name??? End // Else Begin Get_Attribute DF_FILE_OPENED Of iFile To iOpen If iOpen Close iFile DFBTR_REMOVE_ALL_OWNERS DFBTR_ADD_OWNER "..SC...." Open (sDriver - ":" - sPath - "\X$FILE") as iFile End_Procedure // OnClick //AB-StoreEnd End_Object // oBrowse_bn Object oTable_fm Is A cRDSForm Set Label To "Source DDF Meta file:" Set Size To 13 150 Set Location To 145 96 Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right //AB-StoreStart Set Enabled_State To False Procedure OnChange Send DisableOrEnableNextPageButton End_Procedure // OnChange //AB-StoreEnd End_Object // oTable_fm //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection Handle ho ho2 hoDD String sTitle sSubTitle sLabel sLabel2 sPath sTable Delegate Get Main_DD To hoDD Get psTitle To sTitle Get psSubTitle To sSubTitle Move (oPath_fm(Self)) To ho Move (oTable_fm(Self)) To ho2 Get Label Of ho To sLabel Get Label Of ho2 To sLabel2 If (pbFrom(Self)) Begin Move (Replace("Destination", sTitle, "Source")) To sTitle Move (Replace("Destination", sSubTitle, "Source")) To sSubTitle Move (Replace("Destination", sLabel, "Source")) To sLabel Move (Replace("Destination", sLabel2, "Source")) To sLabel2 Get Field_Current_Value Of hoDD Field SncTable.FromFilePath To sPath Get psFromDDFFile To sTable End // If (pbFrom(Self)) Begin Else Begin Move (Replace("Source", sTitle, "Destination")) To sTitle Move (Replace("Source", sSubTitle, "Destination")) To sSubTitle Move (Replace("Source", sLabel, "Destination")) To sLabel Move (Replace("Source", sLabel2, "Destination")) To sLabel2 Get Field_Current_Value Of hoDD Field SncTable.ToFilePath To sPath Get psToDDFFile To sTable End // Else Begin If (Length(sTable) = 0) Move "File.ddf" To sTable If (Length(sPath) > 0) Begin Set Value Of ho To sPath Set Value Of ho2 To sTable End // If (Length(sPath) > 0) Begin Else Begin Set Value Of ho To "" Set Value Of ho2 To "" End // Else Begin Set psTitle To sTitle Set psSubTitle To sSubTitle Set Label Of ho To sLabel Set Label Of ho2 To sLabel2 If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin Send DisableOrEnableNextPageButton End Send Activate Of oBrowse_bn End_Procedure // OnEntering //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage Handle hoWizardPages hoNextPage Get piCurrentpage To iCurrentPage Move (iCurrentPage + 1) To iPage Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Set pbFrom Of hoNextPage To (pbFrom(Self)) Function_Return iPage End_Function // piNextPage //Function ConfirmPageChange Integer iDirection Returns Integer // Function_Return True //End_Function // ConfirmPageChange //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange //Procedure OnLeaving Integer iTo Integer iDirection // Forward Send OnLeaving iTo iDirection //End_Procedure // OnLeaving //*** //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if at least one method is //*** selected. Procedure DisableOrEnableNextPageButton Integer iRetval String sPath sTable Get Value Of oPath_fm To sPath Get Value Of oTable_fm To sTable Get vFilePathExists (sPath - "\" - sTable) To iRetval Set Enabled_State Of oNextButton To (iRetval And sPath <> "" And sTable <> "") End_Procedure // DisableOrEnableNextPageButton On_Key Key_Alt+Key_O Send KeyAction Of oBrowse_bn //AB-StoreEnd End_Object // oPervasive Object oSelectPervasiveTable Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "Select the Source Data Table to Connect to" Set psSubTitle To "On this page you select the Source data table to connect to" Object oTables_lst Is A List Set Size To 170 218 Set Location To 50 30 Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right //AB-StoreStart Function IsFillList Returns Boolean Integer iFile iRetval iCount iStop String sTableName sValue Boolean bFrom Delegate Get pbFrom To bFrom If bFrom Delegate Get piFromDDFFile To iFile Else Delegate Get piToDDFFile To iFile Send StartWorkingMessage ("Scanning File.DDF file for Data Tables:") Set Dynamic_Update_State To False Send Delete_Data Indicate Err False Clear iFile Vfind iFile 0 Gt While (Found) Get_Field_Value iFile 2 To sTableName Move (Trim(sTableName)) To sTableName If Not (sTableName Contains "X$") Send Add_item msg_None sTableName Vfind iFile 0 Gt Loop Send Sort_Items // Refind and highlight a previously selected table if user re-enters the tab-page: If (Item_Count(Self)) Begin If (pbFrom(Self)) Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromDataTable To sTableName Else Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToDataTable To sTableName Move (Trim(sTableName)) To sTableName If (Length(sTableName) > 0) Begin For iCount From 0 To (Item_Count(Self) - 1) Get Value Item iCount To sValue If (sValue = sTableName) Move 1 To iStop If iStop Break Loop If iStop Set Select_State Item iCount To True End // If (Length(sTableName) > 0) Begin Else Begin Move (Err) To iStop Send OnChange // Setting current_item to 0 does not trigger OnChange. Indicate Err as iStop // OnChange tries to open the table. Needed if the open fails. End // Else Begin End // If (Item_Count(Self)) Begin Else Move 1 To iRetval Set Dynamic_Update_State To True Send StopWorkingMessage Function_Return (Err + iRetval) End_Function // IsFillList Procedure OnChange String sValue Integer iFile iItem Handle hoDD If (Item_Count(Self) = 0) Procedure_Return Get Current_Item To iItem Get Value Item iItem To sValue If (Length(sValue) = 0) Procedure_Return Delegate Get Main_DD To hoDD If (pbFrom(Self)) Begin Set Field_Changed_Value Of hoDD Field SncTable.FromDataTable To sValue Set Field_Changed_Value Of hoDD Field SncTable.FromFile To 10 End Else Begin Set Field_Changed_Value Of hoDD Field SncTable.ToDataTable To sValue Set Field_Changed_Value Of hoDD Field SncTable.ToFile To 20 End Get RDSOpenAsFile hoDD (pbFrom(Self)) False To iFile End_Procedure // OnChange //AB-StoreEnd End_Object // oTables_lst Object oViewData_bn Is A Button Set Label To "&View Data" Set Location To 120 276 //AB-StoreStart Procedure OnClick Integer iFile If (pbFrom(Self)) Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.FromFile To iFile Else Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.ToFile To iFile If iFile Send DoStartViewData iFile 1 True 0 End_Procedure // OnClick //AB-StoreEnd End_Object // oViewData_bn //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection String sTitle sSubTitle Get psTitle To sTitle Get psSubTitle To sSubTitle If (pbFrom(Self)) Begin Move (Replace("Destination", sTitle, "Source")) To sTitle Move (Replace("Destination", sSubTitle, "Source")) To sSubTitle Set psTitle To sTitle Set psSubTitle To sSubTitle End // If (pbFrom(Self)) Begin Else Begin Move (Replace("Source", sTitle, "Destination")) To sTitle Move (Replace("Source", sSubTitle, "Destination")) To sSubTitle Set psTitle To sTitle Set psSubTitle To sSubTitle End // Else Begin //*** Fill the list if we are entering this in forward direction If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin Send InitializeObjects Send DisableOrEnableNextPageButton End Set Enabled_State Of oNextButton To True Send Activate Of oTables_lst End_Procedure // OnEntering Procedure InitializeObjects Integer iRetval Get IsFillList Of oTables_lst To iRetval Set psTitle To ("Select the Pervasive (Btrieve) Data Table to Connect to") End_Procedure // InitializeObjects //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange Procedure OnLeaving Integer iTo Integer iDirection Handle ho Integer iCurrent iFile iOpen String sPath sTable sDriver If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin // Move (oTables_lst(Self)) To ho // Get Current_Item Of ho To iCurrent // Get Value Of ho item iCurrent To sTable // If (pbFrom(Self)) ; // Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.FromDataTable To sTable // Else ; // Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.ToDataTable To sTable End // If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin //*** Make sure we are able to use the next button on whatever page we are going to // Get RDSOpenAsFile (Main_DD(Self)) (pbFrom(Self)) False To iOpen Set Enabled_State Of oNextButton To True End_Procedure // OnLeaving //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage iType Handle hoWizardPages hoNextPage hoDD Boolean bFrom Get piCurrentpage To iCurrentPage If (pbFrom(Self)) Begin Move (Not(pbFrom(Self))) To bFrom Delegate Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field SncTable.TodbType To iType If (iType = 1) Move (iCurrentPage -10) To iPage // DataFlex. Else If (iType = 2) Move (iCurrentPage - 9) To iPage // IBM DB2 UDB Else If (iType = 3) Move (iCurrentPage - 7) To iPage // MS SQL Else If (iType = 4) Move (iCurrentPage - 5) To iPage // ODBC Else If (iType = 5) Move (iCurrentPage - 3) To iPage // Oracle Else If (iType = 6) Move (iCurrentPage - 1) To iPage // Pervasive End // (pbFrom(Self)) Begin Else Begin Move (pbFrom(Self)) To bFrom Move (iCurrentPage + 1) To iPage End // Else Begin //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Set pbFrom Of hoNextPage To bFrom Function_Return iPage End_Function // piNextPage //*** //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if at least one method is //*** selected. Procedure DisableOrEnableNextPageButton End_Procedure // DisableOrEnableNextPageButton On_Key Key_Alt+Key_V Send KeyAction Of oViewData_bn //AB-StoreEnd End_Object // oSelectPervasiveTable Object oLogin Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True Property Boolean pbLoginOk False //AB-StoreTopEnd Set psSubTitle To "On this page you specify the necessary login details" Object oInfo_tb Is A cTextbox //AB-StoreTopStart Set Label To ("Please enter the User ID and Password details for the Source data table." * ; "The information is used by the Synchronize program to auto login to the database.") //AB-StoreTopEnd Set Auto_Size_State To False Set Location To 44 30 Set Size To 21 314 Set Justification_Mode To jMode_Left Set TypeFace To "MS Sans Serif" End_Object // oInfo_tb Object oInfo2_tb Is A cTextbox //AB-StoreTopStart Set Label To ("NOTE: Before you move on you need to test the login details by pressing the 'Test Login' button.") //AB-StoreTopEnd Set Auto_Size_State To False Set Location To 67 30 Set Size To 21 314 Set Justification_Mode To jMode_Left Set TypeFace To "MS Sans Serif" End_Object // oInfo2_tb Object oServer_fm Is A Form Set Label To "Server:" Set Size To 13 169 Set Location To 105 66 Set Status_Help To "DSN/Server name" Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right End_Object // oServer_fm Object oAuthentication_cb Is A CheckBox Set Label To "Use Windows NT authentication" Set Size To 10 119 Set Location To 108 238 Set Status_Help To "Check if to use Windows login User id and password" //AB-StoreStart Set Entry_msg To DoCheckEntering Procedure DoCheckEntering Returns Integer Boolean bState Get Visible_State To bState If bState Procedure_Return 0 Else Procedure_Return 1 End_Procedure // DoCheckEntering Procedure OnChange Boolean bState String sTrusted Get Checked_State To bState Set Enabled_State Of oUser_fm To (Not(bState)) Set Enabled_State Of oPassword_fm To (Not(bState)) Set Value Of oUser_fm To "" Set Value Of oPassword_fm To "" End_Procedure // OnChange //AB-StoreEnd End_Object // oAuthentication_cb Object oUser_fm Is A Form Set Label To "User Name:" Set Size To 13 169 Set Location To 121 66 Set Status_Help To "User id for loggin in to the database" Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right End_Object // oUser_fm Object oPassword_fm Is A Form Set Label To "Password:" Set Size To 13 169 Set Location To 136 66 Set Status_Help To "Password for loggin in to the database" Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right //AB-StoreStart Set Password_State Item 0 To True //AB-StoreEnd End_Object // oPassword_fm Object oDatabase_fm Is A Form Set Label To "Data Table:" Set Size To 13 169 Set Location To 151 66 Set Status_Help To "Data table name" Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right //AB-StoreStart Set Entry_msg To DoCheckEntering Procedure DoCheckEntering Returns Integer Boolean bState Get Visible_State To bState If bState Procedure_Return 0 Else Procedure_Return 1 End_Procedure // DoCheckEntering //AB-StoreEnd End_Object // oDatabase_fm Object oSchema_fm Is A Form Set Label To "Schema:" Set Size To 13 169 Set Location To 166 66 Set Status_Help To "The Schema name or table Owner" Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right End_Object // oSchema_fm Object oTest_bn Is A Button Set Label To "&Test Login" Set Location To 166 238 //AB-StoreStart Procedure OnClick String sServer sUser sPassword sDriver Handle hoDD Delegate Get Main_DD To hoDD Get Value Of oServer_fm To sServer Get Value Of oUser_fm To sUser Get Value Of oPassword_fm To sPassword If (pbFrom(Self)) ; Get Field_Current_Value Of hoDD Field SncTable.FromDriver To sDriver Else ; Get Field_Current_Value Of hoDD Field SncTable.ToDriver To sDriver Send Ignore_Error Of Error_Info_Object 12293 Send Ignore_Error Of Error_Info_Object 28692 Indicate Err False Login sServer sUser sPassword sDriver If (Err) Begin Send Info_Box "Login unsuccessful. Please try again." Set pbLoginOk To False End // If (Err) Begin Else Begin Send Info_Box "Login successful." Set pbLoginOk To True End // Else Begin Send Trap_Error Of Error_Info_Object 12293 Send Trap_Error Of Error_Info_Object 28692 Send DisableOrEnableNextPageButton End_Procedure // OnClick //AB-StoreEnd End_Object // oTest_bn //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection Handle ho String sText Move (oInfo_tb(Self)) To ho Get Value Of ho Item 0 To sText If (pbFrom(Self)) Begin Move (Replace("Destination", sText, "Source")) To sText Set Label Of ho To sText End // If (pbFrom(Self)) Begin Else Begin Move (Replace("Source", sText, "Destination")) To sText Set Label Of ho To sText End // Else Begin If (iDirection = WIZARD_FORWARD_NAVIGATE) ; Send InitializeObjects Send DisableOrEnableNextPageButton Send Activate Of oUser_fm End_Procedure // OnEntering Procedure InitializeObjects String sDriver sServer sDatabase sUser sOwner sPassword sText sPrefix Handle hoDD Integer iFile iPos iType Get Main_DD To hoDD If (pbFrom(Self)) Begin Get Field_Current_Value Of hoDD Field SncTable.FromDbType To iType Get Field_Current_Value Of hoDD Field SncTable.FromDriver To sDriver Get Field_Current_Value Of hoDD Field SncTable.FromServer To sServer Get Field_Current_Value Of hoDD Field SncTable.FromDataTable To sDatabase Get Field_Current_Value Of hoDD Field SncTable.FromOwner To sOwner Get Field_Current_Value Of hoDD Field SncTable.FromPv To sPassword End // If (pbFrom(Self)) Begin Else Begin Get Field_Current_Value Of hoDD Field SncTable.ToDbType To iType Get Field_Current_Value Of hoDD Field SncTable.ToDriver To sDriver Get Field_Current_Value Of hoDD Field SncTable.ToServer To sServer Get Field_Current_Value Of hoDD Field SncTable.ToDataTable To sDatabase Get Field_Current_Value Of hoDD Field SncTable.ToOwner To sOwner Get Field_Current_Value Of hoDD Field SncTable.ToPv To sPassword End // Else Begin If (Length(sOwner) = 0) Get Network_User_Name To sOwner Get Network_User_Name To sUser Move (Pos("=", sServer)) To iPos If iPos Begin Move (Left(sServer, iPos)) To sPrefix Move (Replace(sPrefix, sServer, "")) To sServer End // If iPos Begin Set Visible_State Of oServer_fm To True Set Visible_State Of oAuthentication_cb To (iType = 3) Set Enabled_State Of oDatabase_fm To False Set Enabled_State Of oServer_fm To False Set Enabled_State Of oSchema_fm To True Set Label Of oSchema_fm To "Schema Name:" Set Label Of oServer_fm To "Server:" Set Value Of oServer_fm To sServer Set Value Of oUser_fm To sUser Set Value Of oPassword_fm To sPassword Set Value Of oDatabase_fm To sDatabase Set Value Of oSchema_fm To sOwner Set Checked_State Of oAuthentication_cb To False Move "Connect to ODBC Login attributes" To sText Case Begin Case (iType = 1) // DataFlex Procedure_Return Case Break Case (iType = 2) // IBM DB2 UDB Set Label Of oServer_fm To "DSN:" Move (Replace("ODBC", sText, "IBM DB2 UDB")) To sText Case Break Case (iType = 3) // MS SQL Set Checked_State Of oAuthentication_cb To True Set Enabled_State Of oUser_fm To False Set Enabled_State Of oPassword_fm To False Move (Replace("ODBC", sText, "Microsoft SQL")) To sText Case Break Case (iType = 4) // ODBC Set Label Of oServer_fm To "DSN:" Case Break Case (iType = 5) // Oracle Move (Replace("ODBC", sText, "Oracle")) To sText Case Break Case (iType = 6) // Pervasive.SQL Set Visible_State Of oServer_fm To False Set Label Of oServer_fm To "" Set Label Of oSchema_fm To "Owner Name:" Move (Replace("ODBC", sText, "Pervasive")) To sText Case Break Case Else // Send Stop_Box "Unkown Database type format." Procedure_Return Case End Set psTitle To sText End_Procedure // InitializeObjects //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage Handle hoWizardPages hoNextPage //*** Determine next page Get piCurrentpage To iCurrentPage Move (iCurrentPage + 1) To iPage //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Set pbFrom Of hoNextPage To (pbFrom(Self)) Function_Return iPage End_Function // piNextPage //Function ConfirmPageChange Integer iDirection Returns Integer // Function_Return True //End_Function // ConfirmPageChange //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange Procedure OnLeaving Integer iTo Integer iDirection Handle hoDD String sServer sUser sPassword sDatabase sSchema sCrnt sDriver sText Boolean bState bFrom If (pbLoginOk(Self)) Begin Delegate Get Main_DD To hoDD Get pbFrom To bFrom If bFrom ; Get Field_Current_Value Of hoDD Field SncTable.FromDriver To sDriver Else ; Get Field_Current_Value Of hoDD Field SncTable.ToDriver To sDriver Get Value Of oServer_fm To sServer Get Value Of oUser_fm To sUser Get Value Of oPassword_fm To sPassword Get CMEnKry sPassword To sPassword Get Value Of oDatabase_fm To sDatabase Get Value Of oSchema_fm To sSchema Get Checked_State Of oAuthentication_cb To bState If ((sDriver = ODBC_DRV_ID Or sDriver = DB2_DRV_ID) And Trim(sServer) <> "") ; Move ("DSN=" + Trim(sServer) + ";") To sText Else If (Trim(sServer) <> "") ; Move ("SERVER=" + Trim(sServer) + ";") To sText If (Not(bState) And Trim(sUser) <> "") ; Move (sText + "UID=" + Trim(sUser) + ";") To sText Else If bState ; Move (sText + "Trusted_Connection=yes;") To sText If (Trim(sDataBase) <> "") ; Move (sText + "DATABASE=" + Trim(sDatabase)) To sText Move (Right(sText, 1)) To sCrnt If (sCrnt = ";") ; Move (Left(sText, (Length(sText) -1))) To sText If bFrom Begin Set Field_Changed_Value Of hoDD Field SncTable.FromLogin To sText Set Field_Changed_Value Of hoDD Field SncTable.FromPv To sPassword Set Field_Changed_Value Of hoDD Field SncTable.FromOwner To sSchema Set Field_Changed_Value Of hoDD Field SncTable.FromDataTable To (sDatabase - ".Int") End // If bFrom Begin Else Begin Set Field_Changed_Value Of hoDD Field SncTable.ToLogin To sText Set Field_Changed_Value Of hoDD Field SncTable.ToPv To sPassword Set Field_Changed_Value Of hoDD Field SncTable.ToOwner To sSchema Set Field_Changed_Value Of hoDD Field SncTable.ToDataTable To (sDatabase - ".Int") End // Else Begin End // If (pbLoginOk(Self)) Begin End_Procedure // OnLeaving //*** //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if at least one method is //*** selected. Procedure DisableOrEnableNextPageButton Set Enabled_State Of oNextButton To (pbLoginOk(Self)) End_Procedure // DisableOrEnableNextPageButton On_Key Key_Alt+Key_T Send KeyAction Of oTest_bn //AB-StoreEnd End_Object // oLogin Object oConstraints Is A cInteriorPage //AB-StoreTopStart // Note: This is not actually used for this page, but // we do need to be able to set it from a previous page... Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "Select constraints (Selection criteria)" Set psSubTitle To "Set Constraints for Source table records to read when synchronizing data." //AB-StoreStart //Function ConfirmPageChange Integer iDirection Returns Integer // Function_Return True //End_Function // ConfirmPageChange //Procedure OnEntering Integer iFrom Integer iDirection //End_Procedure // OnEntering //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange //Procedure OnLeaving Integer iTo Integer iDirection //End_Procedure // OnLeaving //AB-StoreEnd End_Object // oConstraints Object oSelectMethodPage Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "Synchronization Type" Set psSubTitle To "On this page you select the method by which the data will be synchronized." Object oMethodText Is A cTextbox //AB-StoreTopStart Set Label To ("Please select the synchronization method.\n\n" + ; "Select 'Range of Field Numbers' if the columns to be synchronized in the two tables are consequtive. However," * ; "the first column does not need to be the same.\n\n" + ; "Select 'Matching Field Names' if the columns to be synchronized in the two tables have the same names.\n\n" + ; "Select 'Selected Field Numbers' if you manually need to match each column in the Source table that is to be" * ; "synchronized, with a column one from the Destination table.\n\n" + ; "Automatic data type convertion will be performed, regardless the synch type selected. I.e. the data type of" * ; "columns in the two tables does not need to be the same. Nor does the length be the same as long as the data" * ; "to be synchronized 'fits' into the Destination table column.") //AB-StoreTopEnd Set Auto_Size_State To False Set Location To 45 30 Set Size To 121 275 Set Justification_Mode To jMode_Left Set TypeFace To "MS Sans Serif" End_Object // oMethodText Object oSynchType_rg Is A RadioGroup Set Size To 54 121 Set Location To 170 30 Object Radio1 Is A Radio Set Label To "Range of Field Numbers" Set Size To 10 93 Set Location To 10 5 End_Object // Radio1 Object Radio2 Is A Radio Set Label To "Matching Field Names" Set Size To 10 87 Set Location To 25 5 End_Object // Radio2 Object Radio3 Is A Radio Set Label To "Selected Field Numbers" Set Size To 10 91 Set Location To 40 5 End_Object // Radio3 //AB-StoreStart Procedure Notify_Select_State Integer iToItem Integer iFromItem Forward Send Notify_Select_State iToItem iFromItem Set Field_Changed_Value Of (Main_DD(Self)) Field SncTable.Synchtype To (iToItem + 1) End_Procedure // If you set Current_radio you must set this after the // radio objects have been created AND after Notify_select_State has been // created. i.e. Set in bottom-code at end!! Set Current_Radio To 1 //AB-StoreEnd End_Object // oSynchType_rg //AB-StoreStart //*** //*** Procedure: OnEntering //*** Purpose : Depending on the selections in the checboxes, enable or disbale the next page button. Procedure OnEntering Integer iFrom Integer iDirection Send DisableOrEnableNextPageButton Send Activate Of oSynchType_rg End_Procedure // OnEntering //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iSynchType iCurrentPage iPage Handle hoWizardPages hoNextPage //*** Determine next page Get Field_Current_Value Of (Main_DD(Self)) Field SncTable.Synchtype To iSynchType Get piCurrentpage To iCurrentPage If (iSynchType = 1) Move (iCurrentPage + 1) To iPage Else If (iSynchType = 2) Move (iCurrentPage + 3) To iPage Else If (iSynchType = 3) Move (iCurrentPage + 2) To iPage //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Function_Return iPage End_Function // piNextPage //*** //*** Procedure: Onleaving //*** Purpose : Make sure next page button is available. Procedure OnLeaving Integer iTo Integer iDirection //*** Make sure we are able to use the next button on whatever page we are going to Set Enabled_State Of oNextButton To True End_Procedure // OnLeaving //*** //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if at least one method is //*** selected. Procedure DisableOrEnableNextPageButton End_Procedure // DisableOrEnableNextPageButton //AB-StoreEnd End_Object // oSelectMethodPage Object oFieldRange Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "Range of Field Numbers" Set psSubTitle To "On this page you select the first and last column for the Source table and the first column for the Destination table." Object oInfo_tb Is A cTextbox //AB-StoreTopStart Set Label To ("Please select a range of fields/columns that should be synchronized for the two" * ; "previously seletected data base tables. Select the first and last field/column numbers" * ; "for the Source table\n\n" + ; "Select the start field/column for the Destination table. The fields/columns following this" * ; "start field must be in the same order as in the Source table.\n\n" + ; "Data will be converted to the appropriate Destination column data type if necessary.") //AB-StoreTopEnd Set Auto_Size_State To False Set Location To 42 15 Set Size To 44 331 Set Justification_Mode To jMode_Left Set TypeFace To "MS Sans Serif" End_Object // oInfo_tb //AB-StoreStart //Function ConfirmPageChange Integer iDirection Returns Integer // Function_Return True //End_Function // ConfirmPageChange Procedure OnEntering Integer iFrom Integer iDirection If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin Send InitializeObjects Send DisableOrEnableNextPageButton End End_Procedure // OnEntering //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange Procedure InitializeObjects Handle hoDD Integer iFromFile iToFile Delegate Get Main_DD To hoDD // Panel property Get Field_Current_Value Of hoDD Field SncTable.FromFile To iFromFile Get Field_Current_Value Of hoDD Field SncTable.ToFile To iToFile //Broadcast Send DoUpdateData of (oFromFile_grp(Self)) iFromFile //Broadcast Send DoUpdateData of (oToFile_grp(Self)) iToFile End_Procedure // InitializeObjects Procedure OnLeaving Integer iTo Integer iDirection //*** Make sure we are able to use the next button on whatever page we are going to Set Enabled_State Of oNextButton To True End_Procedure // OnLeaving //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage Handle hoWizardPages hoNextPage //*** Determine next page Get piCurrentpage To iCurrentPage Move (iCurrentPage + 2) To iPage //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Function_Return iPage End_Function // piNextPage //*** //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if at least one method is //*** selected. Procedure DisableOrEnableNextPageButton Handle hoDD Integer iFromStartField iFromStopField iToStartField Delegate Get Main_DD To hoDD // Panel property Get Field_Current_Value Of hoDD Field SncTable.FromStartField To iFromStartField Get Field_Current_Value Of hoDD Field SncTable.FromStopField To iFromStopField Get Field_Current_Value Of hoDD Field SncTable.ToStartField To iToStartField Set Enabled_State Of oNextButton To (iFromStartField And iFromStopField And iToStartField) End_Procedure // DisableOrEnableNextPageButton //AB-StoreEnd End_Object // oFieldRange Object oSelectedFieldNumbers Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "Selected Field Numbers" Set psSubTitle To "On this page you match fields/columns for the Source table with fields/columns for the Destination table." Object oInfo_tb Is A cTextbox //AB-StoreTopStart Set Label To ("Press the 'Select Field Numbers' button to popup the selection dialog." * ; "Match each field/column for the Source table with one field/column for" * ; "the Destination table. The fields/columns for the two tables will get synchronized" * ; "in the order you select them, top to bottom.\n\n" + ; "Press the 'View Data' button to inspect sample data. It will help you deciding" * ; "which fields/columns to match.\n\n" + ; "You can use the 'Append' button to e.g. concatenate a First_Name field and a" * ; "Family_Name field/column for the Source table to a single Name field in the" * ; "Destination table.") //AB-StoreTopEnd Set Auto_Size_State To False Set Location To 46 33 Set Size To 74 302 Set Justification_Mode To jMode_Left Set TypeFace To "MS Sans Serif" End_Object // oInfo_tb //AB-StoreStart //Function ConfirmPageChange Integer iDirection Returns Integer // Function_Return True //End_Function // ConfirmPageChange Procedure OnEntering Integer iFrom Integer iDirection If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin Send InitializeObjects Send DisableOrEnableNextPageButton End End_Procedure // OnEntering Procedure InitializeObjects Handle hoDD Integer iFromFile iToFile Delegate Get Main_DD To hoDD // Panel property Get Field_Current_Value Of hoDD Field SncTable.FromFile To iFromFile Get Field_Current_Value Of hoDD Field SncTable.ToFile To iToFile //Broadcast Send DoUpdateData Of (oFromFields_lst(Self)) iFromFile //Broadcast Send DoUpdateData Of (oToFields_lst(Self)) iToFile End_Procedure // InitializeObjects //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange //Procedure OnLeaving Integer iTo Integer iDirection //End_Procedure // OnLeaving //*** //*** Procedure: DisableOrEnableNextPageButton //*** Purpose : Only allow transition forward if at least one method is //*** selected. Procedure DisableOrEnableNextPageButton Handle hoDD String sSelFromFields sSelToFields Delegate Get Main_DD To hoDD // Panel property Get Field_Current_Value Of hoDD Field SncTable.SelFromFields To sSelFromFields Get Field_Current_Value Of hoDD Field SncTable.SelToFields To sSelToFields Set Enabled_State Of oNextButton To (sSelFromFields <> "" And sSelToFields <> "") End_Procedure // DisableOrEnableNextPageButton //AB-StoreEnd End_Object // oSelectedFieldNumbers Object oAnsiOEM Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "Ansi <--> OEM conversion" Set psSubTitle To "On this page you specify in what format data is saved for the Source table and what format should be used to save data in the Destination table" Object oInfo_tb Is A cTextbox //AB-StoreTopStart Set Label To ("Please select in what format (Ansi or OEM) the Source table was saved in and the format" * ; "data should be saved for the Destination table.\n" + ; "Use the buttons to popup a dialog to view sample data for the Source and Destination table, respectively") //AB-StoreTopEnd Set Auto_Size_State To False Set Location To 42 10 Set Size To 30 342 Set Justification_Mode To jMode_Left Set TypeFace To "MS Sans Serif" End_Object // oInfo_tb //AB-StoreStart //Function ConfirmPageChange Integer iDirection Returns Integer // Function_Return True //End_Function // ConfirmPageChange Procedure OnEntering Integer iFrom Integer iDirection //*** Fill the list if we are entering this in forward direction If (iDirection = WIZARD_FORWARD_NAVIGATE) Begin Send InitializeObjects End End_Procedure // OnEntering Procedure InitializeObjects Handle hoDD Integer iFromFile iToFile Delegate Get Main_DD To hoDD // Panel property Get Field_Current_Value Of hoDD Field SncTable.FromFile To iFromFile Get Field_Current_Value Of hoDD Field SncTable.ToFile To iToFile //Broadcast Send DoUpdateData of (oFromFile_grp(Self)) iFromFile //Broadcast Send DoUpdateData of (oToFile_grp(Self)) iToFile End_Procedure // InitializeObjects //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange //Procedure OnLeaving Integer iTo Integer iDirection //End_Procedure // OnLeaving //*** //*** Function: piNextPage //*** Purpose : Returns the number of the next page. This depends on the selections the user made. Function piNextPage Returns Integer Integer iCurrentPage iPage iFile Handle hoDD hoWizardPages hoNextPage String sRetval Delegate Get Main_DD To hoDD // Panel property Get Field_Current_Value Of hoDD Field SncTable.ToFile To iFile If iFile Get_Attribute DF_FILE_DRIVER Of iFile To sRetval //*** Determine next page Get piCurrentpage To iCurrentPage If (sRetval = ODBC_DRV_ID Or sRetval = DB2_DRV_ID Or sRetval = MSSQLDRV_ID) ; Move (iCurrentPage + 1) To iPage Else ; Move (iCurrentPage + 2) To iPage //*** Set your own next page and make sure the next page jumps back here. Forward Set piNextPage To iPage Move (oWizardPages(Self)) To hoWizardPages Get Value Of hoWizardpages Item iPage To hoNextPage Set piPreviousPage Of hoNextPage To iCurrentPage Function_Return iPage End_Function // piNextPage //AB-StoreEnd End_Object // oAnsiOEM Object oNulDefaults Is A cInteriorPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psTitle To "Null defaults" Set psSubTitle To "On this page any Null defaults for Destination table columns are specified." //AB-StoreStart //Function ConfirmPageChange Integer iDirection Returns Integer // Function_Return True //End_Function // ConfirmPageChange Procedure OnEntering Integer iFrom Integer iDirection // If (iDirection = WIZARD_FORWARD_NAVIGATE) ; // Send ProcessSelections End_Procedure // OnEntering //Procedure OnPageChange Integer iFrom Integer iTo Integer iDirection //End_Procedure // OnPageChange //Procedure OnLeaving Integer iTo Integer iDirection //End_Procedure // OnLeaving //AB-StoreEnd End_Object // oNulDefaults Object oCompletionPage Is A cCompletionPage //AB-StoreTopStart Property Boolean pbFrom True //AB-StoreTopEnd Set psWatermark To "Wizard.Bmp" Set psTitle To "Table Setup record Wizard Completed" Set psDescription To "You are almost done..." Set psBottomText To "Click on finish to create the Table Setup record and exit the wizard" Object oTextBox1 Is A Textbox Set Label To "User Display Name:" Set Color To clWhite Set Location To 167 119 Set Size To 10 63 Set TypeFace To "MS Sans Serif" End_Object // oTextBox1 Object oSnctable_Checkintegrity Is A dbCheckBox Entry_Item Snctable.Checkintegrity Set Label To "Check for database integrity" Set Size To 13 110 Set Location To 153 185 Set Color To clWhite End_Object // oSnctable_Checkintegrity Object oSncTable_Text_fm Is A dbForm Entry_Item Snctable.Text Set Label To "User Display Name:" Set Size To 13 168 Set Location To 167 185 Set TextColor To clBlack Set Label_Col_Offset To 2 Set Label_Justification_Mode To jMode_Right //AB-StoreStart Set Oem_Translate_State To False On_Key kFind Send msg_None On_Key kFind_Next Send msg_None On_Key kFind_Previous Send msg_None On_Key kSuper_Find Send msg_None On_Key kSuper_Find_Next Send msg_None On_Key kSuper_Find_Previous Send msg_None On_Key kBegin_Of_Data Send msg_None On_Key kEnd_Of_Data Send msg_None //AB-StoreEnd End_Object // oSncTable_Text_fm //AB-StoreStart Procedure OnEntering Integer iFrom Integer iDirection String sText Integer iType Get Field_Current_Value Of SncTable_DD Field SncTable.SynchType To iType If (iType = 2) Set Checked_State Of oSnctable_Checkintegrity To False Set Enabled_State Of oSnctable_Checkintegrity To (iType <> 2) If (iType = 2) Begin Move ("There is no need to check for database integrity when synchronization type '2 - Matching Field Names' is choosen and the checkbox has therefor been disabled.") ; To sText End // If (iType = 2) Begin Else Begin Move ("Check for database integrity checkbox. ") To sText Move (sText + "A snapshot will be taken of the fields datatype and precision") To sText Move (sText * "for the two tables up and until the highest selected field number.\n\n") To sText Move (sText + "That info will be used to check that the two tables has not been changed") To sText Move (sText * "before a synchronization is run. If a change is encountered it will be") To sText Move (sText * "saved as a warning to the log file and no synchronizition will be performed.") To sText End // Else Begin Set psDescription To (sText + "\n\nAlos enter a user display name for the Table Setup record to be created.\n" + ; "The entered user description will get displayed in the Setup and" * ; "and Synchronize program grids.") End_Procedure // OnEntering //AB-StoreEnd End_Object // oCompletionPage //AB-StoreStart Set Locate_Mode To CENTER_ON_SCREEN Procedure FinishWizard Handle hoDD ho String sDesc sWorkspace sCurrentWorkspace Integer iRetval iSynchType Get Main_DD To hoDD Get Field_Current_Value Of hoDD Field SncTable.Text To sDesc If (Trim(sDesc) = "") Begin Send Info_Box "You need to enter a 'User Display Name' for the record that is to be created. Please try again." Procedure_Return End // If (Trim(sDesc) = "") Begin Get Field_Current_Value Of hoDD Field SncTable.SynchType To iSynchType If (iSynchType <> 2) Get UpdateIntegrityInfo Of hoDD To iRetval // Func in DDO class. If iRetval Procedure_Return Set Field_Changed_Value Of hoDD Field SncTable.Interface To 1 // Generic interface! Get Request_Validate Of hoDD To iRetval If iRetval Begin Send Info_Box "The validation to create the record failed. Cannot save. Re-check your selections." Procedure_Return End // If iRetval Begin Send Request_Save Of hoDD Send Info_Box "Record created.\nYou can now press the 'Field Value Transformation' button at the bottom of the 'Table Setup' tab-page to add value transformation records, if needed." Get Field_Current_Value Of hoDD Field SncTable.Recnum To iRetval //Get psSelectedWorkSpace Of hoDD To sWorkspace // Get Main_DD of (oSDIPanel(Self)) to hoDD // Get phoCurrentWorkSpace_fm of (oSDIPanel(Self)) to ho // Get psSelectedWorkSpace of hoDD to sCurrentWorkspace // If (Trim(sWorkspace) <> Trim(sCurrentWorkspace)) Begin // We need to re-init the tab-page's Workspace. // Send DoInitSelectedWorkSpace of ho sWorkSpace // End // If (Trim(sWorkspace) <> Trim(sCurrentWorkspace)) Begin // Send Request_Clear_All of hoDD // Send Find_By_Recnum of hoDD SncTable.File_Number iRetval Forward Send FinishWizard End_Procedure // FinishWizard // Must have this. Else we get DDO errors when RDC program is closed: Procedure Request_Cancel // Send Info_Box "Request_Cancel" Send Clear_All Of (Main_DD(Self)) Forward Send Request_Cancel End_Procedure Function RdsMain_Panel_Id Returns Integer Function_Return Self End_Function // RdsMain_Panel_Id //AB-StoreEnd End_Object // oConnectDbWizard //AB-StoreStart //AB-StoreEnd //AB/ End_Object // prj