Next Topic

Previous Topic

Book Contents

Connect

bool Connect(string sConnectString,int iClientType=TLuaDB.CLIENT_ODBC)

Return values

True if the connection was successfully executed, false if an error occurred.

Parameters

  • sConnectString - A client specific connect string. See remarks section for more information
  • iClientType - Type of client to communicate with, see options below:

Remarks

The connect string is client specific , below are the currently supported clients.

CLIENT _ODBC

Connect string example:

sConnectString = "DSN=test;UID=test;PWD=test";

This connect string uses a datasource named test and supplies the username (UID) and password (PWD) to the DSN.

If no username and password is needed the connect can be formated like this.

sConnectString = "DSN=test;";

Network Monitor is executing as a service, the datasource needs to be a system datasource. This is different from the IDE that can utilize user DSN as well.

CLIENT _SQLSERVER

Connect string example:

sConnectString = "myserver@mydatabase";

To connect to a named instance of SQL Server 2000:

sConnectString = "myserver\\instance_name@mydatabase";

CLIENT _MYSQL

Connect string example:

sConnectString = "myserver";

Connecting to a server listening to a custom port

sConnectString = "myserver:portnumber";

Note that the MySQL client library needs to be installed and included in the default search path so it may be found by Network Monitor and the IDE.