MBS FileMaker Plugin Example Databases

MySQL example

All examples are included with download of MBS FileMaker Plugin.

MySQL example.fmp12

Overview
Tables2
Relationships0
Layouts2
Scripts6
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
tbl_SQL
10 fields defined, 3 records
tbl_SQL
tbl_customer
5 fields defined, 5 records
tbl_customer

Fields

Table Name: tbl_SQL - 10 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
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
                  BirthdayNormal, DateAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                          NumberOfOrdersNormal, NumberAuto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German
                                  TotalSalesNormal, NumberAuto-Enter:
                                  • Allow editing
                                  Validation:
                                  • Only during data entry
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: None
                                  • Automatically create indexes as needed
                                  • Index Language: German
                                          PathToMySQLLibraryNormal, TextAuto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Global
                                          • Repetitions: 1
                                          • Index Language: German
                                          old _PathToSQLiteLibrary
                                              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
                                                      Server_and_Database_nameNormal, TextAuto-Enter:
                                                      • Allow editing
                                                      Validation:
                                                      • Only during data entry
                                                      Storage:
                                                      • Global
                                                      • Repetitions: 1
                                                      • Index Language: German
                                                          sSQLNormal, TextAuto-Enter:
                                                          • Allow editing
                                                          Validation:
                                                          • Only during data entry
                                                          Storage:
                                                          • Global
                                                          • Repetitions: 1
                                                          • Index Language: German

                                                              Table Name: tbl_customer - 5 Fields
                                                              Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
                                                              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
                                                                      BirthdayNormal, DateAuto-Enter:
                                                                      • Allow editing
                                                                      Validation:
                                                                      • Only during data entry
                                                                      Storage:
                                                                      • Repetitions: 1
                                                                      • Indexing: None
                                                                      • Automatically create indexes as needed
                                                                      • Index Language: German
                                                                          NumberOfOrdersNormal, NumberAuto-Enter:
                                                                          • Allow editing
                                                                          Validation:
                                                                          • Only during data entry
                                                                          Storage:
                                                                          • Repetitions: 1
                                                                          • Indexing: None
                                                                          • Automatically create indexes as needed
                                                                          • Index Language: German
                                                                              TotalSalesNormal, NumberAuto-Enter:
                                                                              • Allow editing
                                                                              Validation:
                                                                              • Only during data entry
                                                                              Storage:
                                                                              • Repetitions: 1
                                                                              • Indexing: None
                                                                              • Automatically create indexes as needed
                                                                              • Index Language: German

                                                                                  Layout Objects: SQL header and customer list

                                                                                  Regular Fields

                                                                                  Field Name: tbl_customer::FirstName
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 240 pt
                                                                                  • Left: 180 pt
                                                                                  • Bottom: 257 pt
                                                                                  • Right: 433 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: tbl_customer::LastName
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 260 pt
                                                                                  • Left: 180 pt
                                                                                  • Bottom: 277 pt
                                                                                  • Right: 433 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: tbl_customer::Birthday
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 278 pt
                                                                                  • Left: 180 pt
                                                                                  • Bottom: 295 pt
                                                                                  • Right: 433 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: tbl_customer::NumberOfOrders
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 298 pt
                                                                                  • Left: 180 pt
                                                                                  • Bottom: 315 pt
                                                                                  • Right: 433 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: tbl_customer::TotalSales
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 316 pt
                                                                                  • Left: 180 pt
                                                                                  • Bottom: 333 pt
                                                                                  • Right: 433 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: tbl_SQL::PathToMySQLLibrary
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 56 pt
                                                                                  • Left: 180 pt
                                                                                  • Bottom: 76 pt
                                                                                  • Right: 433 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: tbl_SQL::Server_and_Database_name
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 94 pt
                                                                                  • Left: 180 pt
                                                                                  • Bottom: 114 pt
                                                                                  • Right: 433 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: tbl_SQL::Username
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 116 pt
                                                                                  • Left: 180 pt
                                                                                  • Bottom: 136 pt
                                                                                  • Right: 433 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: tbl_SQL::Password
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 137 pt
                                                                                  • Left: 180 pt
                                                                                  • Bottom: 157 pt
                                                                                  • Right: 433 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: tbl_SQL::sSQL
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 168 pt
                                                                                  • Left: 180 pt
                                                                                  • Bottom: 230 pt
                                                                                  • Right: 775 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: Create MySQL Database
                                                                                    Additional Properties:
                                                                                  • Change to hand cursor over button
                                                                                  • Rectangular
                                                                                  • Top: 12 pt
                                                                                  • Left: 12 pt
                                                                                  • Bottom: 38 pt
                                                                                  • Right: 163 pt
                                                                                  • Anchoring: Left, Top
                                                                                  Perform Script [ “CreateDatabase”; Parameter: tbl_SQL::sSQL ]

                                                                                  Scripts:

                                                                                  Fields:


                                                                                  Button PropertiesCoordinatesScript/Script Step
                                                                                    Type:
                                                                                  • Text: Export selected record to MySQL database
                                                                                    Additional Properties:
                                                                                  • Change to hand cursor over button
                                                                                  • Rectangular
                                                                                  • Top: 12 pt
                                                                                  • Left: 175 pt
                                                                                  • Bottom: 38 pt
                                                                                  • Right: 444 pt
                                                                                  • Anchoring: Left, Top
                                                                                  Perform Script [ “ExportRecord” ]

                                                                                  Scripts:


                                                                                  Button PropertiesCoordinatesScript/Script Step
                                                                                    Type:
                                                                                  • Text: Import Records from MySQL Database
                                                                                    Additional Properties:
                                                                                  • Change to hand cursor over button
                                                                                  • Rectangular
                                                                                  • Top: 12 pt
                                                                                  • Left: 454 pt
                                                                                  • Bottom: 38 pt
                                                                                  • Right: 687 pt
                                                                                  • Anchoring: Left, Top
                                                                                  Perform Script [ “Import” ]

                                                                                  Scripts:


                                                                                  Button PropertiesCoordinatesScript/Script Step
                                                                                    Type:
                                                                                  • Text: Trace on
                                                                                    Additional Properties:
                                                                                  • Change to hand cursor over button
                                                                                  • Rectangular
                                                                                  • Top: 12 pt
                                                                                  • Left: 696 pt
                                                                                  • Bottom: 38 pt
                                                                                  • Right: 787 pt
                                                                                  • Anchoring: Left, Top
                                                                                  Set Variable [ $result; Value:MBS("Trace") ]

                                                                                  Button PropertiesCoordinatesScript/Script Step
                                                                                    Type:
                                                                                  • Text: Excecute SQL
                                                                                    Additional Properties:
                                                                                  • Change to hand cursor over button
                                                                                  • Rectangular
                                                                                  • Top: 168 pt
                                                                                  • Left: 12 pt
                                                                                  • Bottom: 194 pt
                                                                                  • Right: 127 pt
                                                                                  • Anchoring: Left, Top
                                                                                  Perform Script [ “Excecute SQL”; Parameter: //Let ($s = tbl_SQL::sSQL;$s ) tbl_SQL::sSQL ]

                                                                                  Scripts:

                                                                                  Fields:


                                                                                  Layout Objects: tbl_customer

                                                                                  Regular Fields

                                                                                  Field Name: tbl_customer::FirstName
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 24 pt
                                                                                  • Left: 138 pt
                                                                                  • Bottom: 41 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: tbl_customer::LastName
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 42 pt
                                                                                  • Left: 138 pt
                                                                                  • Bottom: 59 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: tbl_customer::Birthday
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 60 pt
                                                                                  • Left: 138 pt
                                                                                  • Bottom: 77 pt
                                                                                  • Right: 259 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: tbl_customer::NumberOfOrders
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 78 pt
                                                                                  • Left: 138 pt
                                                                                  • Bottom: 95 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: tbl_customer::TotalSales
                                                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                  • Top: 96 pt
                                                                                  • Left: 138 pt
                                                                                  • Bottom: 113 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

                                                                                  Script Hierarchy

                                                                                  CreateDatabase
                                                                                  Excecute SQL
                                                                                  ExportRecord
                                                                                  Import
                                                                                  OpenDatabase
                                                                                  RegisterMBS

                                                                                  Next Script: [Excecute SQL]
                                                                                  Script NameCreateDatabase
                                                                                  Run script with full access privilegesOff
                                                                                  Include In MenuYes
                                                                                  Layouts that use this script
                                                                                  Scripts that use this script
                                                                                    Script Definition
                                                                                    Script Steps
                                                                                    • Perform Script [ “OpenDatabase” ]
                                                                                    • Set Variable [ $Connection; Value:Get (ScriptResult) ]
                                                                                    • #Create a table
                                                                                    • Set Variable [ $Command; Value:MBS( "SQL.NewCommand"; $Connection; "CREATE TABLE tbl_test(id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), FirstName VARCHAR (32), LastName VARCHAR (32), Birthday DATE, NumberOfOrders INTEGER, TotalSales DOUBLE)" ) ]
                                                                                    • Set Variable [ $result; Value:MBS("SQL.Execute"; $Command) ]
                                                                                    • Set Variable [ $result2; Value:MBS("SQL.Commit"; $Connection) ]
                                                                                    • Set Variable [ $result2; Value:MBS("SQL.FreeCommand"; $Command) ]
                                                                                    • If [ $result ≠ "OK" ]
                                                                                    • Show Custom Dialog [ Message: "Error: " & $result; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                    • Else
                                                                                    • Show Custom Dialog [ Message: "Database created."; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                    • End If
                                                                                    • 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: [CreateDatabase]Next Script: [ExportRecord]
                                                                                                Script NameExcecute SQL
                                                                                                Run script with full access privilegesOff
                                                                                                Include In MenuYes
                                                                                                Layouts that use this script
                                                                                                Scripts that use this script
                                                                                                  Script Definition
                                                                                                  Script Steps
                                                                                                  • Perform Script [ “OpenDatabase” ]
                                                                                                  • Set Variable [ $Connection; Value:Get (ScriptResult) ]
                                                                                                  • #Create a table
                                                                                                  • Set Variable [ $SQL_string; Value:tbl_SQL::sSQL ]
                                                                                                  • Show Custom Dialog [ Title: "SP"; Message: Get (ScriptParameter); Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                                                                  • Set Variable [ $Command; Value:MBS( "SQL.NewCommand"; $Connection; $SQL_string; ) ]
                                                                                                  • Set Variable [ $result; Value:MBS("SQL.Execute"; $Command) ]
                                                                                                  • Set Variable [ $result2; Value:MBS("SQL.Commit"; $Connection) ]
                                                                                                  • Set Variable [ $result2; Value:MBS("SQL.FreeCommand"; $Command) ]
                                                                                                  • If [ $result ≠ "OK" ]
                                                                                                  • Show Custom Dialog [ Message: "Error: " & $result; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                  • Else
                                                                                                  • Show Custom Dialog [ Message: "Database created."; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                  • End If
                                                                                                  • 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: [Excecute SQL]Next Script: [Import]
                                                                                                        Script NameExportRecord
                                                                                                        Run script with full access privilegesOff
                                                                                                        Include In MenuYes
                                                                                                        Layouts that use this script
                                                                                                        Scripts that use this script
                                                                                                          Script Definition
                                                                                                          Script Steps
                                                                                                          • Perform Script [ “OpenDatabase” ]
                                                                                                          • Set Variable [ $Connection; Value:Get (ScriptResult) ]
                                                                                                          • #Create insert command with setting values
                                                                                                          • Set Variable [ $Command; Value:MBS("SQL.NewCommand"; $Connection; "INSERT INTO tbl_test (FirstName, LastName, Birthday, NumberOfOrders, TotalSales) VALUES (:1,:2,:3,:4,:5)") ]
                                                                                                          • Set Variable [ $result; Value:MBS("SQL.SetParamAsText"; $Command; 1; tbl_customer::FirstName) ]
                                                                                                          • Set Variable [ $result; Value:MBS("SQL.SetParamAsText"; $Command; 2; tbl_customer::LastName) ]
                                                                                                          • Set Variable [ $result; Value:MBS("SQL.SetParamAsDate"; $Command; 3; tbl_customer::Birthday) ]
                                                                                                          • Set Variable [ $result; Value:MBS("SQL.SetParamAsNumber"; $Command; 4; tbl_customer::NumberOfOrders) ]
                                                                                                          • Set Variable [ $result; Value:MBS("SQL.SetParamAsFloat"; $Command; 5; tbl_customer::TotalSales) ]
                                                                                                          • #Run it
                                                                                                          • Set Variable [ $result; Value:MBS("SQL.Execute"; $Command) ]
                                                                                                          • #Cleanup
                                                                                                          • Set Variable [ $result2; Value:MBS("SQL.Commit"; $Connection) ]
                                                                                                          • Set Variable [ $result2; Value:MBS("SQL.FreeCommand"; $Command) ]
                                                                                                          • If [ $result ≠ "OK" ]
                                                                                                          • Show Custom Dialog [ Message: "Error: " & $result; Default Button: “OK”, Commit: “No”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                          • Else
                                                                                                          • Show Custom Dialog [ Message: "Record exported."; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                          • End If
                                                                                                          • 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: [ExportRecord]Next Script: [OpenDatabase]
                                                                                                                Script NameImport
                                                                                                                Run script with full access privilegesOff
                                                                                                                Include In MenuYes
                                                                                                                Layouts that use this script
                                                                                                                Scripts that use this script
                                                                                                                  Script Definition
                                                                                                                  Script Steps
                                                                                                                  • Perform Script [ “OpenDatabase” ]
                                                                                                                  • Set Variable [ $Connection; Value:Get (ScriptResult) ]
                                                                                                                  • #Create select and run it
                                                                                                                  • Set Variable [ $Command; Value:MBS("SQL.NewCommand"; $Connection; "SELECT * FROM tbl_test") ]
                                                                                                                  • #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
                                                                                                                  • Loop
                                                                                                                  • Set Variable [ $result; Value:MBS("SQL.FetchNext"; $Command) ]
                                                                                                                  • Exit Loop If [ $result ≠ 1 ]
                                                                                                                  • New Record/Request
                                                                                                                  • Set Field [ tbl_customer::FirstName; MBS("SQL.GetFieldAsText"; $command; "FirstName") ]
                                                                                                                  • Set Field [ tbl_customer::LastName; MBS("SQL.GetFieldAsText"; $command; "LastName") ]
                                                                                                                  • Set Field [ tbl_customer::Birthday; MBS("SQL.GetFieldAsDate"; $command; "Birthday") ]
                                                                                                                  • Set Field [ tbl_customer::TotalSales; MBS("SQL.GetFieldAsFloat"; $command; "TotalSales") ]
                                                                                                                  • Set Field [ tbl_customer::NumberOfOrders; MBS("SQL.GetFieldAsNumber"; $command; "NumberOfOrders") ]
                                                                                                                  • Commit Records/Requests [ No dialog ]
                                                                                                                  • End Loop
                                                                                                                  • Show Custom Dialog [ Message: "Records imported."; 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.Commit"; $Connection) ]
                                                                                                                  • 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: [Import]Next Script: [RegisterMBS]
                                                                                                                        Script NameOpenDatabase
                                                                                                                        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") ]
                                                                                                                          • Set Variable [ $db; Value:tbl_SQL::Server_and_Database_name ]
                                                                                                                          • Set Variable [ $name; Value:tbl_SQL::Username ]
                                                                                                                          • Set Variable [ $pass; Value:tbl_SQL::Password ]
                                                                                                                          • #Tell plugin we want to use MySQL
                                                                                                                          • Set Variable [ $result; Value:MBS("SQL.SetClient"; $Connection; "MySQL") ]
                                                                                                                          • #Tell plugin where SQLite library is
                                                                                                                          • Set Variable [ $result; Value:MBS("SQL.SetConnectionOption"; $Connection; "MYSQL.LIBS"; tbl_SQL::PathToMySQLLibrary) ]
                                                                                                                          • #Connect to database in read/write/create mode. Creates new file if none exists.
                                                                                                                          • // Set Variable [ $result; Value:MBS("SQL.Connect"; $Connection; tbl_SQL::PathToMySQLLibrary & "@" & tbl_SQL::Server_and_Database_name & ";" & tbl_SQL::Username & ";" & tbl_SQL::Password & ";" & "MySQL") //Original string: //MBS("SQL.Connect"; $Connection; SQLite fun::Servername & "\@" & SQLite fun::Database_name;SQLite fun::Username; SQLite //fun::Password; "MySQL") ]
                                                                                                                          • Set Variable [ $result; Value:MBS("SQL.Connect"; $Connection;$db; $name; $pass; "MySQL") ]
                                                                                                                          • If [ $result = "OK" ]
                                                                                                                          • // Show Custom Dialog [ Title: "OK :)"; Message: "OK :)"; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                                                                                          • Exit Script [ Result: $Connection ]
                                                                                                                          • Else
                                                                                                                          • Show Custom Dialog [ Message: "Error: " & $result; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                                          • Set Variable [ $result; Value:MBS("SQL.FreeConnection"; $Connection) ]
                                                                                                                          • Halt Script
                                                                                                                          • End If
                                                                                                                          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: [OpenDatabase]
                                                                                                                                  Script NameRegisterMBS
                                                                                                                                  Run script with full access privilegesOff
                                                                                                                                  Include In MenuYes
                                                                                                                                  Layouts that use this script
                                                                                                                                    Scripts that use this script
                                                                                                                                      Script Definition
                                                                                                                                      Script Steps
                                                                                                                                      • #/** This script registers the plug-in. You need to place you registation function into the script step below */
                                                                                                                                      • #Your registeration function goes in the next script step You can find your registration function in the email response that came when you purchaed the function It should look something like this. MBS("Register"; "Your Name"; "Window"; "5 seats"; 200803; 0123456789)
                                                                                                                                      • Set Variable [ $result; Value:MBS("Register"; "Your Name"; "Window"; "5 seats"; 200803; 123456789) ]
                                                                                                                                      • #If the code is correct it the $result variable with equal "OK"
                                                                                                                                      • If [ $result = "OK" ]
                                                                                                                                      • // Show Custom Dialog [ Title: "Sucess"; Message: "The plug-in was registered succesfully."; Default Button: “OK”, Commit: “No” ]
                                                                                                                                      • Else
                                                                                                                                      • Show Custom Dialog [ Title: "Error"; Message: "The plug-in was NOT registered correctly?"; Default Button: “OK”, Commit: “No” ]
                                                                                                                                      • End If
                                                                                                                                      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: MySQL example

                                                                                                                                                    Used functions:




                                                                                                                                                    Links
                                                                                                                                                    MBS Xojo PDF Plugins