dbSetPassword#

Purpose#

Sets the database connection’s password.

Format#

dbSetPassword(db_id, pswd)#
Parameters:
  • db_id (scalar) – database connection index number.

  • pswd (string) – password for database.

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 connection credentials before opening
dbSetUserName(db_id, "admin");
dbSetPassword(db_id, "secretpass");

// Open the connection
dbSetDatabaseName(db_id, "mydb");
dbOpen(db_id);

See also

dbGetPassword()