SQLite DB Engine Open
 
Open method 

Opens or creates a SQLite database.

Syntax:

b = object.Open( dbfile [, Mode = 0])

Parameters:

dbfile - Database file to open or create if it does not exist already.

Mode - currently ignorred.

Return value: Boolean success indicator (True - success, False - Failure). If failed check LastError for the error text.

Examples:

Set db = Server.CreateObject("newObjects.sqlite.dbutf8")
If db.Open(Server.MapPath("/db/mydb.db")) Then
  ' Continue with the actual work
  ' ...
Else
  ' Deal with the error further
  Response.Write "Error occured: " & db.LastError
  ' ... 
End If

Remarks:

The database file can be opened in shared mode - i.e. different pages or even different applications can use separate SQLite COM objects to open and use the same database. However, it is recommended to use the programming environment capabilities and use single SQLite COM object if it is possible. Especially for Windows CE devices this could be crucial because of the platform limitations in the file locking area of functionality. For instance in ASP/ALP applications the Application can be used to hold the opened object. If the write operations are not too frequent opening and closing the DB in each page is good enough (it is quite fast) but you may need to configure the BusyTimeout in order to avoid failures when collisions occur. 

Applies to: SQLite COM object

See also: Close, BusyTimeout,LastError

Supported on:

Windows 95/NT and later
Windows CE 3.0 and later
Pocket PC/Windows Mobile 2003 and later
Windows CE.NET 4 and later

 

newObjects Copyright 2001-2006 newObjects [ ]