160 likes | 733 Views
TaskMaster. Ken Crosson. CS 8628, Summer 2003. Priority Manager. Add task on handheld or desktop Set task attributes (priority, description, due date, etc.) Synchronize remote and consolidated databases. Sequence of Tasks.
E N D
TaskMaster Ken Crosson CS 8628, Summer 2003 Priority Manager
Add task on handheld or desktop Set task attributes (priority, description, due date, etc.) Synchronize remote and consolidated databases Sequence of Tasks
This program tracks prioritized tasks. The user is able to create, categorize, prioritize, and update tasks, and synchronize his task list between his handheld and desktop computers. The program uses a SQL Server database as the consolidated database, with an Ultralite database on the handheld. Project Description
Logical Schema This schema was produced in Microsoft Visio
CREATE TABLE [dbo].[tbActivity] ( [ActivityID] [uniqueidentifier] NOT NULL , [Name] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Description] [varchar] (1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO CREATE TABLE [dbo].[tbCategory] ( [CategoryID] [uniqueidentifier] NOT NULL , [Name] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Description] [varchar] (1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO CREATE TABLE [dbo].[tbNote] ( [NoteID] [uniqueidentifier] NOT NULL , [TaskID] [uniqueidentifier] NOT NULL , [DateCreated] [datetime] NULL , [Note] [varchar] (1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO CREATE TABLE [dbo].[tbStatus] ( [StatusID] [int] IDENTITY (1, 1) NOT NULL , [Name] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Description] [varchar] (1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO CREATE TABLE [dbo].[tbTask] ( [TaskID] [uniqueidentifier] NOT NULL , [Name] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [Description] [varchar] (1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [DateCreated] [datetime] NULL , [DateDue] [datetime] NULL , [DateDueOriginal] [datetime] NULL , [DateCompleted] [datetime] NULL , [CategoryID] [uniqueidentifier] NOT NULL , [Priority] [int] NULL , [StatusID] [int] NOT NULL ) ON [PRIMARY] GO CREATE TABLE [dbo].[tbTaskActivity] ( [TaskActivityID] [uniqueidentifier] NOT NULL , [TaskID] [uniqueidentifier] NOT NULL , [Note] [varchar] (1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [DateCreated] [datetime] NULL , [ActivityID] [uniqueidentifier] NOT NULL ) ON [PRIMARY] GO Physical Schema (DDL)
CREATE PUBLICATION pub_tasks ( TABLE tbTask (TaskID, Name, Description, DateCreated, DateDue, Status, Priority, Category ) ); Publication Script # 1
CREATE SYNCHRONIZATION SUBSCRIPTION TO pub_task FOR sub_user TYPE 'tcpip' ADDRESS 'host=localhost' Synchronization Script
Unfamiliar technology has made this very difficult. AppForge product is somewhat less user-friendly than it could be. New technology provides faster, easier ways to achieve the same result. Difficulties Encountered
Public Sub LoadTasks() On Error GoTo ErrHandler Dim conn_parms As String Dim open_parms As String Dim schema_parms As String conn_parms = "uid=DBA;pwd=SQL" open_parms = conn_parms & ";" & "FILE_NAME=" & App.Path & "\TaskMaster.udb" schema_parms = open_parms & ";" & "SCHEMA_FILE=" & App.Path & "\TaskMaster.usm" On Error Resume Next Set Connection = DatabaseMgr.OpenConnection(open_parms) If Err.Number <> ulSQLE_NOERROR Then If Err.Number = ULSQLCode.ulSQLE_DATABASE_NOT_FOUND Then Err.Clear Set Connection = DatabaseMgr.CreateDatabase(schema_parms) Else MsgBox Err.Description & Err.Source End If End If Set oTaskTable = Connection.GetTable("tbTask") oTaskTable.Open oTaskTable.MoveBeforeFirst oTaskTable.MoveFirst If Err.Number <> ULSQLCode.ulSQLE_NOERROR Then MsgBox Err.Description ExitHandler: Exit Sub ErrHandler: RaiseErr Me, "LoadTasks" End Sub Code Sample # 1
Private Sub AddNew() Dim sName As String Dim sDescription As String Dim dDate As Date Dim nStatus As Integer Dim nCategory As Integer Dim nPriority As Integer sName = txtName.Text sDescription = txtDescription.Text If IsDate(txtDate.Text) Then dDate = CDate(txtDate.Text) Else dDate = Date End If nStatus = cboStatus.ListIndex nCategory = cboCategory.ListIndex nPriority = cboPriority.ListIndex On Error GoTo InsertError oTaskTable.InsertBegin oTaskTable.Column("Name").StringValue = sName oTaskTable.Column("Description").StringValue = sDescription oTaskTable.Column("DateDue").DatetimeValue = dDate oTaskTable.Column("Status").IntegerValue = nStatus oTaskTable.Column("Category").IntegerValue = nCategory oTaskTable.Column("Priority").IntegerValue = nPriority oTaskTable.Insert oTaskTable.MoveLast DisplayCurrentRow Exit Sub InsertError: MsgBox "Error: " & CStr(Err.Description) End Sub Code Sample # 2
AppForge’s MobileVB environment is an acceptable way to develop for for the PocketPC, but in many ways is inferior to the environment provided by VisualStudio.NET. Ultralite for MobileVB is a useful tool for deploying and synchronizing remote databases, but could stand to be more intuitive. Conclusion