OpenDatabase()

Syntax

Result = OpenDatabase(#Database, DatabaseName$, User$, Password$ [, Plugin])
Description
Opens a new database connection.

Parameters

#Database A number to identify the new database. #PB_Any can be used to auto-generate this number.
DatabaseName$ The name of the database to open.
User$ The user name for the connection.
Password$ The password for the connection. This can be an empty string if no password is required.
Plugin (optional) Specifies the database plug-in to use. It can be one of the following value:
  #PB_Database_ODBC      : The database will use ODBC backend (UseODBCDatabase() has to be called).
  #PB_Database_SQLite    : The database will use SQLite backend (UseSQLiteDatabase() has to be called).
  #PB_Database_PostgreSQL: The database will use PostgreSQL backend (UsePostgreSQLDatabase() has to be called).
  #PB_Database_MySQL     : The database will use MySQL backend (UseMySQLDatabase() has to be called).
If 'Plugin' isn't specified, then the first registered database plug-in will be used.

Return value

Returns nonzero if the database connection was established successfully and zero if not. Error information can be received with the DatabaseError() command. If #PB_Any was used for the #Database parameter, then the generated number is returned.

See Also

OpenDatabaseRequester(), CloseDatabase(), UseODBCDatabase(), UseSQLiteDatabase(), UsePostgreSQLDatabase(), UseMySQLDatabase()

Supported OS

All

<- NextDatabaseRow() - Database Index - OpenDatabaseRequester() ->