###User Defined Function###
_SQLite_Open

###Description###
Opens/creates a SQLite database.

###Syntax###
#include <SQLite.au3>
_SQLite_Open ( [$sDatabase_Filename = ":memory:" [, $iAccessMode = Default [, $iEncoding = $SQLITE_ENCODING_UTF8]]] )


###Parameters###
@@ParamTable@@
$sDatabase_Filename
	[optional] Database filename, by default will open a memory database.
$iAccessMode
	[optional] access mode flags. Defaults to $SQLITE_OPEN_READWRITE + $SQLITE_OPEN_CREATE
$iEncoding
	[optional] encoding mode flag, only used at creation time. Defaults to $SQLITE_ENCODING_UTF8
@@End@@

###ReturnValue###
@@ReturnTable@@
Success:	a database handle.
Failure:	0.
@error:	-1 - SQLite Reported an Error (Check @extended Value)
	1 - Error Calling SQLite API 'sqlite3_open_v2'
	2 - Error while converting filename to UTF-8
	3 - <a href="SQLiteStartup.htm">SQLiteStartup()</a> not yet called
@extended:	value can be compared against $SQLITE_* constants
@@End@@


###Remarks###
There is no need to store the database handle, except if you use more than one database in the same session.
Functions that use the handle are using the last opened by default.

To create a database encoded in UFT16 just create it with $iEncoding = $SQLITE_ENCODING_UTF16.

Memory, temporary and permanent databases can be opened:
	$hDb = <a href="_SQLite_Open.htm">_SQLite_Open()</a>                      ; opens a temporary private memory DB
	$hDb = <a href="_SQLite_Open.htm">_SQLite_Open</a>(Default, ...)          ; ditto
	$hDb = <a href="_SQLite_Open.htm">_SQLite_Open</a>(':memory:', ...)       ; ditto

	$hDb = <a href="_SQLite_Open.htm">_SQLite_Open</a>('', ...)               ; opens a temporary private on-disk DB

	$hDb = <a href="_SQLite_Open.htm">_SQLite_Open</a>('abc.db', ...)         ; opens or creates a permanent shareable on-disk DB named 'abc.db'

	In case you insist confusing yourself:
	$hDb = <a href="_SQLite_Open.htm">_SQLite_Open</a>('./:memory:', ...)     ; opens or creates a permanent shareable on-disk DB named ':memory:'

Contrary to permanent disk-based DBs, memory and temporary DBs can't be shared nor be used for IPC (Inter Process Communication) and are destroyed at the end of the connection.


###Related###
_SQLite_Close


###Example###
@@IncludeExample@@
