sqlite_open

mIRC SQLite

sqlite_open
Opens a SQLite database.
Syntax
$sqlite_open ( [ db [, from ] ] )
Parameters
db
The filename of the database to open. Optional, see remarks for details.
from
The filename of the database to create memory database from. Optional, see remarks for details.
Return Value
A positive, numeric connection identifier if successful, or $null if there was an error.
Remarks
The db argument is optional, if it isn't specified, a transient database is opened in a temporary file. If specified, and the file db doesn't exist, an empty database will be created on that file.

If db is equal to the special keyword :memory: a memory database is opened instead of a file database. If from is specified the memory database will contain a copy of the specified database, otherwise an empty memory database is created. If file from doesn't exist, an empty database will be created on that file.
from is only valid when :memory: is used, otherwise an error is raised.

If $null is returned you can determine the exact reason for the error by checking the value of %sqlite_errstr.
For more information about error handling, see Handling Errors
Example
; Opens a database and displays the status after. Closes the db if it was opened successfully.
var %db = $sqlite_open(test.db)
if (%db) {
  echo -a Database opened successfully.
  sqlite_close %db
}
else {
  echo -a Error opening database: %sqlite_errstr
}