dbSetPort#

Purpose#

Sets the specified database connection’s port number.

Format#

dbSetPort(db_id, port_num)#
Parameters:
  • db_id (scalar) – database connection index number.

  • port_num (scalar) – port number for database connection to use.

Remarks#

This function must be called before the connection is opened with dbOpen() to have an effect.

Examples#

// Add MySQL to the list of database connections
db_id = dbAddDatabase("MYSQL");

// Set the port number before opening
dbSetPort(db_id, 3306);

// Configure remaining settings and open
dbSetHostName(db_id, "localhost");
dbSetDatabaseName(db_id, "mydb");
dbOpen(db_id);

See also

dbGetPort()