dbSetUserName#

Purpose#

Sets the specified database connection’s user name.

Format#

dbSetUserName(db_id, user_name)#
Parameters:
  • db_id (scalar) – database connection index number.

  • user_name (string) – user name to apply to specified database connection.

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 user name before opening
dbSetUserName(db_id, "db_user");

// Configure remaining settings and open
dbSetDatabaseName(db_id, "mydb");
dbSetPassword(db_id, "password");
dbOpen(db_id);

See also

dbGetUserName()