Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

Microsoft SQL Execute

All examples are included with download of MBS FileMaker Plugin.

Microsoft SQL Execute.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts2
Value Lists0
Custom Functions0
Custom Menus33
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
Microsoft SQL Execute
5 fields defined, 1 record
Microsoft SQL Execute

Fields

Table Name: Microsoft SQL Execute - 5 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
InputNormal, NumberAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
        OutputNormal, NumberAuto-Enter:
        • Allow editing
        Validation:
        • Only during data entry
        Storage:
        • Repetitions: 1
        • Indexing: None
        • Automatically create indexes as needed
        • Index Language: German
            Connection StringNormal, TextAuto-Enter:
            • Allow editing
            Validation:
            • Only during data entry
            Storage:
            • Global
            • Repetitions: 1
            • Index Language: German
                UsernameNormal, TextAuto-Enter:
                • Allow editing
                Validation:
                • Only during data entry
                Storage:
                • Global
                • Repetitions: 1
                • Index Language: German
                    PasswordNormal, TextAuto-Enter:
                    • Allow editing
                    Validation:
                    • Only during data entry
                    Storage:
                    • Global
                    • Repetitions: 1
                    • Index Language: German

                        Layout Objects: Microsoft SQL Execute

                        Regular Fields

                        Field Name: Microsoft SQL Execute::Input
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 108 pt
                        • Left: 138 pt
                        • Bottom: 122 pt
                        • Right: 217 pt
                        • Anchoring: Left, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: System Default
                        • Go to next field using: Tab key
                        Yes

                        Field Name: Microsoft SQL Execute::Output
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 126 pt
                        • Left: 138 pt
                        • Bottom: 140 pt
                        • Right: 217 pt
                        • Anchoring: Left, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: System Default
                        • Go to next field using: Tab key
                        Yes

                        Field Name: Microsoft SQL Execute::Connection String
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 30 pt
                        • Left: 138 pt
                        • Bottom: 44 pt
                        • Right: 391 pt
                        • Anchoring: Left, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: System Default
                        • Go to next field using: Tab key
                        No

                        Field Name: Microsoft SQL Execute::Username
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 48 pt
                        • Left: 138 pt
                        • Bottom: 62 pt
                        • Right: 391 pt
                        • Anchoring: Left, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: System Default
                        • Go to next field using: Tab key
                        No

                        Field Name: Microsoft SQL Execute::Password
                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                        • Top: 66 pt
                        • Left: 138 pt
                        • Bottom: 80 pt
                        • Right: 391 pt
                        • Anchoring: Left, Top
                        Field Format:
                        • Edit Box
                        Field Behavior:
                        • Allow field to be entered: In Find mode, In Browse mode
                        • Touch keyboard type: System Default
                        • Go to next field using: Tab key
                        No

                        Script Hierarchy

                        Run
                        Trace

                        Next Script: [Trace]
                        Script NameRun
                        Run script with full access privilegesOff
                        Include In MenuYes
                        Layouts that use this script
                          Scripts that use this script
                            Script Definition
                            Script Steps
                            • Set Variable [ $Connection; Value:MBS("SQL.NewConnection") ]
                            • #Tell plugin what ole provider to use
                            • Set Variable [ $result; Value:MBS("SQL.SetConnectionOption"; $Connection; "OLEDBProvider"; "SQLNCLI") ]
                            • #Tell plugin we want to use Microsoft SQL Server
                            • Set Variable [ $result; Value:MBS("SQL.SetClient"; $Connection; "SQLServer") ]
                            • #Connect to database in read/write/create mode. Creates new file if none exists.
                            • Set Variable [ $result; Value:MBS("SQL.Connect"; $Connection; Microsoft SQL Execute::Connection String; Microsoft SQL Execute::Username; Microsoft SQL Execute::Password) ]
                            • If [ $result ≠ "OK" ]
                            • Show Custom Dialog [ Message: "Error: " & $result; Default Button: “OK”, Commit: “No”; Button 2: “Abbrechen”, Commit: “No” ]
                            • Set Variable [ $result; Value:MBS("SQL.FreeConnection"; $Connection) ]
                            • Exit Script [ ]
                            • End If
                            • #Create select and run it
                            • Set Variable [ $SQL; Value:"Test" ]
                            • Set Variable [ $Command; Value:MBS("SQL.NewCommand"; $Connection; $sql) ]
                            • Set Variable [ $r; Value:MBS("SQL.SetParamAsNumber"; $Connection; "Param1"; 7) ]
                            • #Run it
                            • Set Variable [ $result; Value:MBS("SQL.Execute"; $Command) ]
                            • If [ $result ≠ "OK" ]
                            • Show Custom Dialog [ Message: "Error: " & $result; Default Button: “OK”, Commit: “No”; Button 2: “Abbrechen”, Commit: “No” ]
                            • Else
                            • Set Variable [ $r; Value:MBS("SQL.FetchNext"; $Command) ]
                            • Set Variable [ $FieldCount; Value:MBS( "SQL.FieldCount";$Command ) ]
                            • Set Variable [ $result; Value: MBS( "SQL.GetFieldAsText"; $Command; 1 ) ]
                            • Set Field [ Microsoft SQL Execute::Output; $result ]
                            • Show Custom Dialog [ Message: "Result: " & $result; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                            • End If
                            • #Cleanup
                            • Set Variable [ $result2; Value:MBS("SQL.FreeCommand"; $Command) ]
                            • Set Variable [ $result2; Value:MBS("SQL.FreeConnection"; $Connection) ]
                            Fields used in this script
                            Scripts used in this script
                              Layouts used in this script
                                Tables used in this script
                                Table occurrences used by this script
                                Custom Functions used by this script
                                  Custom menu set used by this script

                                    Previous Script: [Run]
                                    Script NameTrace
                                    Run script with full access privilegesOff
                                    Include In MenuYes
                                    Layouts that use this script
                                      Scripts that use this script
                                        Script Definition
                                        Script Steps
                                        • Set Variable [ $r; Value:MBS("Trace") ]
                                        Fields used in this script
                                          Scripts used in this script
                                            Layouts used in this script
                                              Tables used in this script
                                                Table occurrences used by this script
                                                  Custom Functions used by this script
                                                    Custom menu set used by this script

                                                      Download example: Microsoft SQL Execute

                                                      Used functions: