<div class="meta" robots="noindex">

</div>

Class

# REALSQLdatabase

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2013r1. Please use `SQLiteDatabase</api/databases/sqlitedatabase>` as a replacement.

</div>

## Description

The <span class="title-ref">REALSQLdatabase</span> class is a legacy class used to access SQLite databases. Use the `SQLiteDatabase</api/databases/sqlitedatabase>` class instead.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                                       | Type                                | Read-Only | Shared |
|------------------------------------------------------------|-------------------------------------|-----------|--------|
| `AutoCommit<realsqldatabase.autocommit>`                   | `Boolean</api/data_types/boolean>`  |           |        |
| `DatabaseFile<realsqldatabase.databasefile>`               | `FolderItem</api/files/folderitem>` |           |        |
| `EncryptionKey<realsqldatabase.encryptionkey>`             | `String</api/data_types/string>`    |           |        |
| `LibraryVersion<realsqldatabase.libraryversion>`           | `String</api/data_types/string>`    | ✓         |        |
| `MultiUser<realsqldatabase.multiuser>`                     | `Boolean</api/data_types/boolean>`  |           |        |
| `ShortColumnNames<realsqldatabase.shortcolumnnames>`       | `Boolean</api/data_types/boolean>`  |           |        |
| `ThreadYieldInterval<realsqldatabase.threadyieldinterval>` | `Integer</api/data_types/integer>`  |           |        |
| `Timeout<realsqldatabase.timeout>`                         | `Double</api/data_types/double>`    |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                                     | Parameters                                                                                                                                      | Returns                                         | Shared |
|----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|--------|
| `AttachDatabase<realsqldatabase.attachdatabase>`         | file As `FolderItem</api/files/folderitem>`, databaseName As `String</api/data_types/string>`, \[password As `String</api/data_types/string>`\] | `Boolean</api/data_types/boolean>`              |        |
| `CreateDataBaseFile<realsqldatabase.createdatabasefile>` |                                                                                                                                                 | `Boolean</api/data_types/boolean>`              |        |
| `Decrypt<realsqldatabase.decrypt>`                       |                                                                                                                                                 |                                                 |        |
| `DetachDatabase<realsqldatabase.detachdatabase>`         | databaseName As `String</api/data_types/string>`                                                                                                |                                                 |        |
| `Encrypt<realsqldatabase.encrypt>`                       | password As `String</api/data_types/string>`                                                                                                    |                                                 |        |
| `LastRowID<realsqldatabase.lastrowid>`                   |                                                                                                                                                 | `Int64</api/data_types/additional_types/int64>` |        |

## Property descriptions

<div id="realsqldatabase.autocommit">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

REALSQLdatabase.AutoCommit

**AutoCommit** As `Boolean</api/data_types/boolean>`

Determines whether the database commits changes automatically, or whether changes open an implicit transaction that you must explicitly close by calling Commit or Rollback. The default is `False</api/language/false>`.

A default of `False</api/language/false>` means that a new transaction is started for you when you use a command that modifies the database. To make these changes permanent, you need to issue a `Commit<database.committransaction>` after you are finished modifying the database. Use `Rollback<database.rollbacktransaction>` to cancel the transaction and your changes. Using transactions greatly improves performance of most databases.

If you change this to `True</api/language/true>`, then a Commit will be issued for you after any command that can modify the database. If you are doing a lot of database updates this can dramatically reduce performance.

<div id="realsqldatabase.databasefile">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

REALSQLdatabase.DatabaseFile

**DatabaseFile** As `FolderItem</api/files/folderitem>`

Specifies the `FolderItem</api/files/folderitem>` for the <span class="title-ref">REALSQLdatabase</span> file. If DatabaseFile is `Nil</api/language/nil>`, calling the Connect method creates an in-memory database.

<div id="realsqldatabase.encryptionkey">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

REALSQLdatabase.EncryptionKey

**EncryptionKey** As `String</api/data_types/string>`

Specifies the encryption key used to create or connect to an encrypted database.

<div id="realsqldatabase.libraryversion">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

REALSQLdatabase.LibraryVersion

**LibraryVersion** As `String</api/data_types/string>`

Returns a `String</api/data_types/string>` containing the version of SQLite used by <span class="title-ref">REALSQLdatabase</span>.

This property is read-only.

<div id="realsqldatabase.multiuser">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

REALSQLdatabase.MultiUser

**MultiUser** As `Boolean</api/data_types/boolean>`

Enables the SQLite Write-Ahead Logging (WAL) mode which can improve performance of database writes. This is especially useful when multiple users are writing to the database, as can be the case with web applications.

<div id="realsqldatabase.shortcolumnnames">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

REALSQLdatabase.ShortColumnNames

**ShortColumnNames** As `Boolean</api/data_types/boolean>`

If `True</api/language/true>`, <span class="title-ref">REALSQLdatabase</span> will use the column names as they appear in table schemas for query results whenever it can. Aliased columns and ambiguous columns will be fully qualified. If `False</api/language/false>`, <span class="title-ref">REALSQLdatabase</span> will return column names exactly as they appeared in the original query. The default value is `True</api/language/true>`.

<div id="realsqldatabase.threadyieldinterval">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

REALSQLdatabase.ThreadYieldInterval

**ThreadYieldInterval** As `Integer</api/data_types/integer>`

Yields time back to your app every *N* virtual machine instructions. The unit is *virtual machine instructions.*

<div id="realsqldatabase.timeout">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

REALSQLdatabase.Timeout

**Timeout** As `Double</api/data_types/double>`

The maximum number of **seconds** that an operation may wait before a lock is cleared (if any).

## Method descriptions

<div id="realsqldatabase.attachdatabase">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

REALSQLdatabase.AttachDatabase

**AttachDatabase**(file As `FolderItem</api/files/folderitem>`, databaseName As `String</api/data_types/string>`, \[password As `String</api/data_types/string>`\]) As `Boolean</api/data_types/boolean>`

Attaches the REAL SQL Database referred to by *file* to the database. It gives the newly attached database the name *databaseName*.

<div id="realsqldatabase.createdatabasefile">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

REALSQLdatabase.CreateDataBaseFile

**CreateDataBaseFile** As `Boolean</api/data_types/boolean>`

Creates a new <span class="title-ref">REALSQLdatabase</span>. It uses the DatabaseFile property as the `FolderItem</api/files/folderitem>` for the database to create.

<div id="realsqldatabase.decrypt">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

REALSQLdatabase.Decrypt

**Decrypt**

Decrypts an encrypted database.

<div id="realsqldatabase.detachdatabase">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

REALSQLdatabase.DetachDatabase

**DetachDatabase**(databaseName As `String</api/data_types/string>`)

Detaches the passed database which was previously attached with AttachDatabase.

<div id="realsqldatabase.encrypt">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

REALSQLdatabase.Encrypt

**Encrypt**(password As `String</api/data_types/string>`)

Encrypts the database using the password as the encryption key. If you pass an empty string, it decrypts the database.

<div id="realsqldatabase.lastrowid">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

REALSQLdatabase.LastRowID

**LastRowID** As `Int64</api/data_types/additional_types/int64>`

Returns an `Int64</api/data_types/additional_types/int64>` containing the value of the last RowID added to any table in the database.

## Notes

<div class="warning">

<div class="title">

Warning

</div>

Switch to `SQLiteDatabase</api/databases/sqlitedatabase>` as this class is deprecated.

</div>

## Compatibility

All project types on all supported operating systems.

## See also

`Database</api/databases/database>` parent class; `SQLiteDatabase</api/databases/sqlitedatabase>`, `DatabaseRow</api/databases/databaserow>`, `PreparedSQLStatement</api/databases/preparedsqlstatement>`, `SQLitePreparedStatement</api/databases/sqlitepreparedstatement>`, `RowSet</api/databases/rowset>` classes.
