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

</div>

Method

# SQLiteDatabase.CreateDatabaseFile

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

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `SQLiteDatabase.CreateDatabase<sqlitedatabase.createdatabase>` as a replacement.

</div>

## Description

Creates a new SQLiteDatabase. It uses the DatabaseFile property as the `FolderItem</api/files/folderitem>` for the database to create.

## Notes

If the database already exists, this function works like `Database.Connect</api/deprecated/deprecated_class_members/database.connect>`. If <span class="title-ref">CreateDatabaseFile</span> does not succeed, an `IOException</api/exceptions/ioexception>` is raised. The old style where this method returned True or False is deprecated as of 2019r2. You should now catch the exception instead.

This example creates a database file and catches the exception if the operation fails:

``` xojo
Var f As FolderItem
f = GetFolderItem("MyDatabase")
Var db As New SQLiteDatabase
db.DatabaseFile = f
Try
  db.CreateDatabaseFile
Catch error As IOException
  MsgBox("The database file could not be created: " + error.Message)
End Try
```

## Compatibility

All project types on all supported operating systems.
