Database.InsertRecord

From Xojo Documentation
Jump to: navigation, search
Method

Database.InsertRecord(TableName as String,Data as DatabaseRecord)

Inserts Data (a populated DatabaseRecord) as a new row in TableName.

Notes

Always check the Error property to verity that the data was added.

Example

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

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
Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About