Difference between revisions of "CalendarView.ExportToDB"
From Jeremie Leroy - XOJO Controls Wiki
Line 25: | Line 25: | ||
CREATE TABLE IF NOT EXISTS `mydb`.`calendar` ( | CREATE TABLE IF NOT EXISTS `mydb`.`calendar` ( | ||
`ID` INT NOT NULL AUTO_INCREMENT, | `ID` INT NOT NULL AUTO_INCREMENT, | ||
− | ` | + | `startDate` DATETIME NOT NULL, |
− | ` | + | `endDate` DATETIME NULL, |
`title` VARCHAR(45) NULL, | `title` VARCHAR(45) NULL, | ||
`description` VARCHAR(200) NULL, | `description` VARCHAR(200) NULL, |
Latest revision as of 16:27, 17 September 2015
Method
CalendarView.ExportToDB ( DB As Database, TableName As String, ID As String = "ID", StartDate As String = "Start", EndDate As String = "End", Title As String = "Title", EventColor As String = "Color", Location As String = "Location", Description As String = "Description", Recurrence As String = "Recurrence" ) As Boolean
Exports all CalendarEvents to the passed TableName in the passed Database.
This function will return True if there is no error. Check DB.ErrorCode and DB.ErrorMessage if this function returns False.
It will update existing records using the CalendarEvent.ID and create new records if the ID isn't set.
The following SQL code can be used to create a compatible database:
CREATE TABLE IF NOT EXISTS `mydb`.`calendar` ( `ID` INT NOT NULL AUTO_INCREMENT, `startDate` DATETIME NOT NULL, `endDate` DATETIME NULL, `title` VARCHAR(45) NULL, `description` VARCHAR(200) NULL, `location` VARCHAR(45) NULL, `color` VARCHAR(10) NULL, `recurrence` VARCHAR(100) NULL, PRIMARY KEY (`ID`))