SqlUtilChangeIntFilesToConnectionIDs - cDbUpdateFunctionLibrary

Enumerates SQL columns/fields for the passed table name and driver ID.


Type: Procedure


Parameters: String sTableName, String sDriverID

Parameter

Description

sDataPath

The path to a Data folder

sConnectionID

The connection ID as defined in the SQLConnection.ini file to change to


Syntax


Procedure SqlUtilChangeIntFilesToConnectionIDs String sDataPath String sConnectionID Boolean bShowResult


Call:

Send SqlUtilChangeIntFilesToConnectionIDs sDataPath sConnectionID True



Description

Use it to change update all intermediate files in a data-folder.



Example


Object oChangeAllIntFiles_btn is a Button

    Set Size to 13 65

    Set Location to 38 320

    Set Label to "GO !"

    Set psToolTip to "Changes or updates all .int files in the selected folder - except for ;

        DAW driver .int files (MSSQL_DRV.int, DB2_DRV.int & ODBC_DRV.int) - to use 'SERVER_NAME DFCONNID=xxx'"

    Set FontWeight to fw_Bold

    Set peAnchors to anTopRight

       

    Procedure OnClick

        String sDataPath sConnectionID

        Boolean bExists

        Integer iRetval

               

        Get Value of oSelectDataPath_fm to sDataPath

        Get vFolderExists sDataPath to bExists

        If (bExists = False) Begin

            Send Info_Box ("The data folder doesn't exist!\n" + sDataPath)

            Procedure_Return    

        End                

        Get Value of oConnectionID_fm to sConnectionID

        Move (Trim(sConnectionID)) to sConnectionID

        If (sConnectionID = "") Begin

            Send Info_Box "You need to specify a Connection_ID to use for the .int files."

            Procedure_Return

        End                

               

        Get YesNo_Box ("Do you want to change all .int files in folder:\n" + sDataPath + "\n\nTo use ;

             'DFCONNID=" + sConnectionID +"' ?") to iRetval

        If (iRetval <> MBR_Yes) Begin

            Procedure_Return

        End  

        Get YesNo_Box "All '.CCH' files will first be deleted. Continue?" to iRetval

        If (iRetval <> MBR_Yes) Begin

            Procedure_Return

        End

               

        Get vDeleteFile (sDataPath + "\*.cch") to iRetval

        If (iRetval <> 0) Begin

            Send Info_Box "Could not delete .cch files!"

            Procedure_Return

        End

       

        Send SqlUtilChangeIntFilesToConnectionIDs of ghoDbUpdateFunctionLibrary ;

             sDataPath sConnectionID True


        Send Info_Box "Ready! All .int files changed."

    End_Procedure

       

End_Object