//**************************************************************************** // $Module type: Class // $Module name: cDatabaseComboForm.pkg // $Author : Nils G. Svedmyr // Created : 2002-05-09 @ 15:19 // // Description : // // $Rev History: // 2002-05-09 Module header created //**************************************************************************** Use cRDSComboForm.pkg // Visual DataFlex 12.0 Migration Utility, added March 28, 2007: 15:13:23 #IF (!@ >= 120) { OverrideProperty=Label_Row_Offset InitialValue=0 } { OverrideProperty=Label_Col_Offset InitialValue=2 } { OverrideProperty=Label_Justification_Mode InitialValue=jMode_Right } { OverrideProperty=Label_Justification_Mode EnumList="jMode_Right, jMode_Left, jMode_Center" } { OverrideProperty=Status_Help InitialValue="Select a Database Format from the list" } { OverrideProperty=Size InitialValue=13,150 } #ENDIF Class cDatabaseComboform is a cRDSComboForm Procedure Construct_Object Forward Send Construct_Object Property String psDriver "" Set Entry_State item 0 to False // On_Key kEnter Send DoSelectItem End_Procedure // Construct_Object // Procedure DoSelectItem // Send Mouse_Down 0 // Send OnCloseUp // End_Procedure // DoSelectItem Procedure End_Construct_Object Forward Send End_Construct_Object End_Procedure // End_Construct_Object Procedure Combo_Fill_List Send Combo_Delete_Data Send Combo_Add_Item "" Send Combo_Add_Item "DataFlex" Send Combo_Add_Item "IBM DB2 Universal Database" Send Combo_Add_Item "Microsoft SQL Server" Send Combo_Add_Item "ODBC Data Sources" Send Combo_Add_Item "Oracle" Send Combo_Add_Item "Pervasive (Btrieve)" End_Procedure // Combo_Fill_List Procedure OnCloseUp String sValue Integer iItem Forward Send OnCloseUp Get Value item 0 To sValue Send DoCheckDriver iItem sValue End_Procedure // OnCloseUp Procedure DoCheckDriver Integer iItem String sValue String sPath sDriver sDriver2 Integer iRetval Get psProgramPath Of (phoWorkspace(ghoApplication)) To sPath If (Right(sPath, 1) = "\") Move (Left(sPath, (Length(sPath) -1))) To sPath Get vFolderExists sPath To iRetval Move 1 To iRetval Case Begin Case (iItem = 0) Move 0 to iRetval // 0 = not Ok. Case Break Case (iItem = 1) Move FLEX_DRV_ID to sDriver Case Break Case (iItem = 2) Move DB2_DRV_ID to sDriver Case Break Case (iItem = 3) Move MSSQLDRV_ID to sDriver Move SQL_DRV_ID to sDriver2 Case Break Case (iItem = 4) Move ODBC_DRV_ID to sDriver Case Break Case (iItem = 5) Move ORA_DRV_ID to sDriver Case Break Case (iItem = 6) Move DFBTRDRV_ID to sDriver Case Break Case End If (Length(sDriver) > 0 or Length(sDriver2) > 0 and sDriver <> FLEX_DRV_ID) Begin If (iItem <> 3) Get Get_File_Exists (sPath - "\" - sDriver - ".DLL") to iRetval Else Begin Get Get_File_Exists (sPath - "\" - sDriver - ".DLL") to iRetval If Not iRetval Get Get_File_Exists (sPath - "\" - sDriver2 - ".DLL") to iRetval End // Else Begin End // If (Length(sDriver) > 0 or Length(sDriver2) > 0) Begin If (Not(iRetval) and iItem <> 0) Begin If (iItem <> 3) ; Send Info_Box ("You need to have the" * sDriver * "database driver installed in\n" + sPath * "\nto be able to use the selected database format.") Else ; Send Info_Box ("You need to have the" * sDriver * "or the" * sDriver2 * "database driver installed in\n" + sPath * "\nto be able to use the selected database format.") End // If (Not(iRetval) and iItem <> 0) Begin If Not iRetval Move "" to sDriver Else Begin Get IsLoadCheckDriver sDriver False To iRetval Set psDriver to sDriver End // Else Begin End_Procedure // DoCheckDriver End_Class // cDatabaseComboform