MBS FileMaker Plugin Example Databases

ODBC Test

All examples are included with download of MBS FileMaker Plugin.

ODBC Test.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
ODBC Test
7 fields defined, 1 record
ODBC Test

Fields

Table Name: ODBC Test - 7 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
DatabaseNameNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
      ServerNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          PortNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              UserNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  PasswordNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      FirstNameNormal, TextAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German
                          LastNameNormal, TextAuto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German

                              Layout Objects: ODBC Test

                              Regular Fields

                              Field Name: ODBC Test::DatabaseName
                              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
                              Yes

                              Field Name: ODBC Test::Server
                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                              • Top: 84 pt
                              • Left: 138 pt
                              • Bottom: 98 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
                              Yes

                              Field Name: ODBC Test::Port
                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                              • Top: 102 pt
                              • Left: 138 pt
                              • Bottom: 116 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
                              Yes

                              Field Name: ODBC Test::User
                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                              • Top: 120 pt
                              • Left: 138 pt
                              • Bottom: 134 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
                              Yes

                              Field Name: ODBC Test::Password
                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                              • Top: 138 pt
                              • Left: 138 pt
                              • Bottom: 152 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
                              Yes

                              Field Name: ODBC Test::FirstName
                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                              • Top: 156 pt
                              • Left: 138 pt
                              • Bottom: 170 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
                              Yes

                              Field Name: ODBC Test::LastName
                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                              • Top: 174 pt
                              • Left: 138 pt
                              • Bottom: 188 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
                              Yes

                              Group Buttons

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

                              Scripts:


                              Script Hierarchy

                              Run

                              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 [ $r; Value:MBS("Trace") ]
                                • Set Variable [ $Connection; Value:MBS("SQL.NewConnection") ]
                                • #Tell plugin we want to use SQLite
                                • Set Variable [ $result; Value:MBS("SQL.SetClient"; $Connection; "ODBC") ]
                                • #Connect to database in read/write/create mode. Creates new file if none exists.
                                • Set Variable [ $ConnectingString; Value: "Driver={FileMaker ODBC};Database=" & ODBC Test::DatabaseName & ";Server=" & ODBC Test::Server & ";PRT=" & ODBC Test::Port & ";UID=" & ODBC Test::User & ";PWD=" & ODBC Test::Password ]
                                • Set Variable [ $result; Value:MBS("SQL.Connect"; $Connection; $ConnectingString) ]
                                • 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 [ $cmd; Value:"INSERT INTO ODBCHost (FirstName,LastName) VALUES (:FirstName,:LastName)" ]
                                • Set Variable [ $Command; Value:MBS("SQL.NewCommand"; $Connection; $cmd) ]
                                • Set Variable [ $r; Value:MBS( "SQL.SetParamAsText"; $Command; "FirstName"; ODBC Test::FirstName ) ]
                                • Set Variable [ $r; Value:MBS( "SQL.SetParamAsText"; $Command; "LastName"; ODBC Test::LastName ) ]
                                • #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” ]
                                • 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: ODBC Test

                                        Used functions:




                                        Links
                                        MBS FileMaker blog