IAPI::ServerDocConnect

property ServerDocConnect.

Allows app or script to connect to an instance of ServerDoc server.

This server is provided as a means to enhance and simplify access to SQLite files over TCP/IP since it deals with one or
several database files and can remotely execute CRUD* SQL commands like querying and updating to and fro data tables.

All you have to do is to write the full pathname of the first target SQLite file into file SQLiteDBList.txt which is located in the
same folder as the server app or into C:\SQLiteDBList.txt, and run the server. For another subsequent SQLite file and so on,
just add subsequently a new line into this text file and that SQLite file will be regconized and ready to be used remotely by any

ServerDoc client application thru ServerDoc API.  *(CRUD stands for Create, Refresh, Update and Delete)

Since version 7.33 of ServerDoc, you can add an alias name in prefix for qualifying a SQLite database into SQLiteDBList.txt:

For example, C:\DBRep\Dummy.sqlite => SimpleDummy|C:\DBRep\Dummy.sqlite

Now then, SimpleDummy can be passed as a parameter instead of fullpath filename c:\DBRep\Dummy.sqlite

 

Futhermore, you can also ATTACH other database file(s) to the first main one in order to aggregate them together. This can be

done like this: SimpleDummy|C:\DBRep\Dummy.sqlite?ATTACH DATABASE 'C:\DBRep\NewBie.sqlite' AS NEWBIE;

To qualify a table into NewBie.sqlite, you can now use NEWBIE.table1, NEWBIE.table2 and so on.

Actually, custom scripts or applications (e.g ISF Desktop) can then rely on this server to manage remotely any kind of
SQL data tables, with any kind of user interface from mere console text to graphic user displaying. Here is an example

 

HRESULT ServerDocConnect(
  BSTR host_or_ip,
  long svr_port,
  long encryptingDataLength,
  long *pVal
);

Parameters

host_or_ip

[in] .   Hostname or IP address which locates the server

 

Since version 2.38.3.4:

Passing host_or_ip = "?" checks if a connection is acknowledged by the ServerDoc application.

Using this call allows client code to poll that a connection is well established when providing/implementing

a callback onServerDocStatus(…) is unnecessary or not possible.

 

The returned value is 1 if well connected, 0 if not yet connected or failed.

 

svr_port

[in,defaultvalue(8088)] . Port number of ServerDoc

encryptingDataLength

[in,defaultvalue(-1)]

Four possible values:

 (1) encryptingDataLength = 0 means no encryption (requires ServerDocMobile.* or ServerDocUnsafe.*)

 (2) encryptingDataLength = -3 means full encryption for all underlying internal messages for ServerDoc API.

       Note that using this value requires version 7.30 or higher of ServerDocMobile.* or ServerDocUnsafe.*

 

 (3) encryptingDataLength = -1 means full encryption with ServerDoc instances.

 (4) encryptingDataLength > 0 means custom length in bytes for encryption with ServerDoc instances.

pVal

[out, retval] The returned value is 1 if succeeded, 0 or other value if failed.

Return Values

S_OK

The operation was successfull.

E_POINTER

A NULL pointer was supplied as an argument.

E_UNEXPECTED

An unexpected error occoured.

See Also

IAPI