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

</div>

Method

# Database_Class.InsertRecord

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

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `Database.AddRow<database.addrow>` as a replacement.

</div>

## Description

Inserts *Data* (a populated `DatabaseRow</api/databases/databaserow>`) as a new row in *TableName*.

## Notes

Always check the `Error</api/exceptions/databaseexception>` property to verity that the data was added.

## Sample code

This code adds a row to an existing Team table with the columns "Name", "Coach" and "City":

``` xojo
Dim row As New DatabaseRecord
' ID will be updated automatically
row.Column("Name") = "Penguins"
row.Column("Coach") = "Bob Roberts"
row.Column("City") = "Boston"

App.DB.InsertRecord("Team", row)

If App.DB.Error Then
  MsgBox("DB Error: " + App.DB.ErrorMessage)
End If
```

## Compatibility

All project types on all supported operating systems.
