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

MBS FileMaker Plugin Example Databases

Firebird Query

All examples are included with download of MBS FileMaker Plugin.

Firebird Query.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts1
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
Firebird Query
6 fields defined, 11 records
Firebird Query

Fields

Table Name: Firebird Query - 6 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
SQLNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
      ResultNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • 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
                  SQLConnectionStringNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Global
                  • Repetitions: 1
                  • Index Language: German
                      PathToFirebirdLibraryNormal, TextAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Global
                      • Repetitions: 1
                      • Index Language: German

                          Layout Objects: Firebird Query

                          Regular Fields

                          Field Name: Firebird Query::SQL
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 96 pt
                          • Left: 138 pt
                          • Bottom: 110 pt
                          • Right: 553 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: Firebird Query::Result
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 114 pt
                          • Left: 138 pt
                          • Bottom: 320 pt
                          • Right: 553 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: Firebird Query::Username
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 18 pt
                          • Left: 138 pt
                          • Bottom: 32 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: Firebird Query::Password
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 36 pt
                          • Left: 138 pt
                          • Bottom: 50 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: Firebird Query::SQLConnectionString
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 54 pt
                          • Left: 138 pt
                          • Bottom: 68 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: Firebird Query::PathToFirebirdLibrary
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 72 pt
                          • Left: 138 pt
                          • Bottom: 86 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

                          Group Buttons

                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Run Query
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 24 pt
                          • Left: 414 pt
                          • Bottom: 49 pt
                          • Right: 493 pt
                          • Anchoring: Left, Top
                          Perform Script [ “RunQuery” ]

                          Scripts:


                          Script Hierarchy

                          RunQuery

                          Script NameRunQuery
                          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") ]
                            • Set Variable [ $Connection; Value:MBS("SQL.NewConnection") ]
                            • #Tell plugin where Firebird library is
                            • If [ Length( Firebird Query::PathToFirebirdLibrary) > 0 ]
                            • Set Variable [ $result; Value:MBS("SQL.SetConnectionOption"; $Connection; "IBASE.LIBS"; Firebird Query::PathToFirebirdLibrary) ]
                            • End If
                            • #Tell plugin we want to use Firebird
                            • Set Variable [ $result; Value:MBS("SQL.SetClient"; $Connection; "Firebird") ]
                            • #Connect to database in read/write/create mode. Creates new file if none exists.
                            • Set Variable [ $result; Value:MBS("SQL.Connect"; $Connection; Firebird Query::SQLConnectionString; Firebird Query::Username; Firebird Query::Password; "Firebird") ]
                            • 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) ]
                            • Halt Script
                            • End If
                            • #Create select and run it
                            • Set Variable [ $Command; Value:MBS("SQL.NewCommand"; $Connection; Firebird Query::SQL) ]
                            • #Run it
                            • Set Variable [ $result; Value:MBS("SQL.Execute"; $Command) ]
                            • If [ $result ≠ "OK" ]
                            • Set Field [ Firebird Query::Result; $result ]
                            • Show Custom Dialog [ Message: "Error: " & $result; Default Button: “OK”, Commit: “No”; Button 2: “Abbrechen”, Commit: “No” ]
                            • Else
                            • Set Variable [ $lines; Value:"" ]
                            • Set Variable [ $fieldcount; Value:MBS("SQL.FieldCount"; $command) ]
                            • Loop
                            • Set Variable [ $result; Value:MBS("SQL.FetchNext"; $Command) ]
                            • Exit Loop If [ $result ≠ 1 ]
                            • Set Variable [ $line; Value:"" ]
                            • Set Variable [ $i; Value:1 ]
                            • Loop
                            • Set Variable [ $v; Value:MBS("SQL.GetFieldAsText"; $command; $i) ]
                            • Set Variable [ $n; Value:MBS("SQL.GetFieldName"; $command; $i) ]
                            • Set Variable [ $line; Value:$line & $n & ": " & $v & ¶ ]
                            • Set Variable [ $i; Value:$i+1 ]
                            • Exit Loop If [ $i > $fieldCount ]
                            • End Loop
                            • Set Variable [ $lines; Value:$lines & ($line & ¶) ]
                            • End Loop
                            • Set Variable [ $lines; Value:$lines & ¶ ]
                            • Set Field [ Firebird Query::Result; $lines ]
                            • 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

                                    Download example: Firebird Query

                                    Used functions: