Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4   8.5    Statistic  

ServerSocket.SendQuery

Sends a query to a Serversocket on another FileMaker instance.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
ServerSocket 3.2 Yes Yes Yes Yes Yes
MBS( "ServerSocket.SendQuery"; Target; Port; Login; Type; Query )   More

Parameters

Parameter Description Example value
Target The target IP or name of the server. Can be an IP or a name. "localhost"
Port The network port of the server to use. 9000
Login The login secret. Server will only answer if the logins match. "Hello"
Type The type of the query. Can be MBSVersion, SQL, Evaluate or Script. "Evaluate"
Query The query to use. Must match the type of query above.
For Script calls please use filename:scriptname:parameter to run a script and use full file name with extension.
"Get(AccountName)"

Result

Returns result or error.

Description

Sends a query to a Serversocket on another FileMaker instance.
This has nothing to do with a FileMaker Server. The plugin starts a socket which answers queries, so the current FileMaker instance becomes a kind of server.
See example database for sample queries.
Queries can be SQL queries, expression evaluation or running scripts.
While you can send queries across the internet, we recommend to use a VPN connection to do so.

Version 6.3 now supports passing IPv4, iPv6, or a host name.

Examples

Query a table with SQL:

MBS( "ServerSocket.SendQuery"; "FrontDeskMac.local"; 9000; "mysecret"; "SQL"; "SELECT JobID, Status FROM JobTable" )

Query the account name of the current user:

MBS( "ServerSocket.SendQuery"; "FrontDeskMac.local"; 9000; "mysecret"; "Evaluate"; "Get(AccountName)" )

Start a script:

MBS( "ServerSocket.SendQuery"; "FrontDeskMac.local"; 9000; "mysecret"; "Script"; "OrderDatabase:PrintLastOrder:5" )

Example Databases

Created 18th August 2014, last changed 31st October 2016


ServerSocket.GetAllowedTypes   -   ServerSocket.SetAllowedScripts

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins