Help Center

CSQLiteStmt.OpenDbmethod

Opens an SQLite database file as specified by the filename argument.

DatabasesmethodCSQLite.incdoc-orphan
No implementation located. This member is documented, but the source scan found no matching declaration. It is likely declared in a header this scan does not resolve, or provided by a macro.

Syntax

FUNCTION OpenDb (BYREF wszFileName AS CONST WSTRING) AS LONG

Parameters

NameDescription
wszFileNameThe database filename.

Return value

Returns SQLITE_OK if successful or an error code otherwise. The ErrMsg methods can be used to obtain an English language description of the error following a failure of the OpenDb method.

Description

Opens an SQLite database file as specified by the filename argument.

Remarks

If the filename is ":memory:", then a private, temporary in-memory database is created for the connection. This in-memory database will vanish when the database connection is closed. Future versions of SQLite might make use of additional special filenames that begin with the ":" character. It is recommended that when a database filename actually does begin with a ":" character you should prefix the filename with a pathname such as "./" to avoid ambiguity.

If the filename is an empty string, then a private, temporary on-disk database will be created. This private database will be automatically deleted as soon as the database connection is closed.

Reference

  • Include file CSQLite.inc
  • Documented in Databases/CSQLite Class.md
  • Topic: CSQLite Class