DatabaseRecord

From Xojo Documentation

Class (inherits from DatabaseRow)

Used to create new Database records (rows). The methods are used to populate the fields in a record (row). Call it once per column.

Methods
BlobColumn DateColumn FieldType
BooleanColumn DoubleColumn Int64Column
Column FieldCount IntegerColumn
CurrencyColumn FieldName PictureColumn

Notes

Assignments via the DateColumn method store the time as well as the date to support the SQL TimeStamp and Time field types (as well as Date). Note that if the date part is January 1, 0001, then this is converted to SQL as only a time (e.g., "18:54:00"), whereas if the date is anything else, it converts to SQL in full form (e.g., "2000-5-30 18:54:00").

Not all field types supported by the DatabaseRecord class are supported by all data sources. Check whether your data source supports the data type returned by the method you are using.

Use the BlobColumn method to save binary data (such as pictures or files) to the table.

Sample Code

Creates a new row in the team table:

Dim row As New DatabaseRecord

row.Column("Name") = "Penguins"
row.Column("Coach") = "Bob Roberts"
row.Column("City") = "Boston"

myDB.InsertRecord("Team", row)

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

See Also

Database, DatabaseField, MySQLCommunityServer, ODBCDatabase, OracleDatabase, PostgreSQLDatabase, RecordSet classes.