Difference between revisions of "CalendarView.ExportToDB"

From Jeremie Leroy - XOJO Controls Wiki
Jump to: navigation, search
 
(16 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
| ownertype=class
 
| ownertype=class
 
| scope=public
 
| scope=public
| parameters=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"
+
| parameters=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"
 
| returntype=Boolean
 
| returntype=Boolean
| version=1.2.0
+
| version=1.4.1
 
| platform=all
 
| platform=all
 
}}
 
}}
Line 13: Line 13:
  
 
Exports all CalendarEvents to the passed'' TableName'' in the passed Database.
 
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:
 +
<source lang="sql">
 +
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`))
 +
</source>

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`))