Difference between revisions of "Talk:Documentation/OOoAuthors User Manual/Base Guide/Planning"
(→Adding and Removing data)
|Line 176:||Line 176:|
o Using Queries for insert / Update / Delete
o Using Queries for insert / Update / Delete
o Working in a form window
o Working in a form window
===The examples used in the book===
===The examples used in the book===
Revision as of 04:38, 4 July 2007
I wrote a document called AndrewBase.odt (available online). This is a basic outline used there:
Information Page 2 Copyright 2 Authors 2 Feedback 2 Acknowledgments 2 Publication date and software version 2
1. Introduction 1 1.1. Introductory comments 1 1.2. Document organization and introduction 1 2. Storing images (binary data) in Base 3 2.1. Create the initial Base document 3 2.1.1. Using the GUI 3 2.1.2. Using a macro 3 2.1.3. Using a macro to open the wizard 4 2.2. Create the table 4 2.2.1. Using the GUI 4 2.2.2. Using a macro 5 2.2.3. Using SQL statements to modify tables 7 2.2.4. Refresh the tables 7 2.2.5. Creating and deleting tables using SQL 8 2.2.6. Increase a field's length 9 2.3. Create a form 10 2.3.1. Using the GUI 10 2.3.2. Using a macro 12 2.4. Open a form using a macro 15 2.5. Accessing the binary data 18 2.5.1. Adding binary data 18 2.5.2. Extracting binary data 19 3. One-To-Many relationships 22 3.1. Create the tables 22 3.1.1. Create the DEALER table 22 3.1.2. Create the ITEM table 23 3.2. Define the data relationships 25 3.3. Add data to the DEALER and ITEM tables 26 4. Forms 29 4.1. The internal object model 29 4.1.1. A control's shape is in the draw page 29 4.1.2. A draw page contains forms 30 4.1.3. A control's data model is in a form 31 4.1.4. A control's view model is in the controller 32 4.1.5. Enabling and setting controls visible – an example 32 4.1.6. Finding a control from an event – an example 33 4.1.7. Control model summary 34 4.2. Database Forms act like a result set 34 4.2.1. Duplicate record macro 35 4.3. Show one item and the corresponding dealer 38 4.4. Use a combo box with the dealer id 40 4.5. Use a list box with the dealer name 41 4.6. Relations in a single table 42 4.6.1. Solution 43 4.6.2. Solution characteristics 44 4.7. Use a “help and fill” button 45 5. Many-to-many relationships 46 6. Database fields 47 6.1. Storing numbers 50 6.1.1. Integer numbers 50 6.1.2. Floating point numbers 51 6.1.3. NUMERIC and DECIMAL types 52 6.2. Bit and Boolean Types 52 6.3. Date and time 53 6.4. Text data 53 6.5. Binary data 54 6.6. Other data type 54 6.7. Database sequences and auto-value fields 54 7. A few easy database definitions 56 7.1. Schema 57 8. Database connections 58 8.1. Obtain a database context 58 8.1.1. Registered data sources 59 8.1.2. Unregistering a data source 59 8.1.3. Registering a data source 59 8.2. Connect to a database 60 8.3. Connect using an interaction handler 61 8.4. Connections 61 8.4.1. Extended SDB connections 63 8.4.2. Meta-data 63 8.4.3. Inspecting the meta-data 70 8.4.4. GetBestRowIdentifier 76 8.4.5. GetColumnPrivileges 77 8.4.6. GetColumns 78 8.4.7. GetExportedKeys 79 8.4.8. GetIndexInfo 81 8.4.9. GetPrimaryKeys 82 8.4.10. GetTablePrivileges 82 8.4.11. GetTables 83 8.4.12. GetTypeInfo() 83 8.4.13. GetUDTS 85 8.4.14. GetVersionColumns 85 8.5. Connections 86 8.6. Connections without a data source 87 8.6.1. Delimited text files 91 8.6.2. Fixed width text files 93 8.6.3. Help, I still can not import my CSV file 98 8.6.4. Address books 99 8.6.5. MySQL using JDBC 100 8.6.6. Paradox using ODBC 100 8.6.7. Conclusion 102 9. Connecting to MySQL using JDBC 103 10. Mailmerge 105 11. Copying an entire database 106 12. General utility macros 107 12.1. Choose a directory 108 12.2. Get a document's directory 109 12.3. Choose a file 109 12.4. Finding a (loaded) OOo document 111 12.5. Append to an array 112 12.6. Compare data in an array 113 12.7. Create a property 113 12.8. Create a Point and a Size 114 12.9. Append a data array to a Calc document 114 12.10. Dynamically call object methods 115 12.11. Display numeric constants as meaningful text 119 12.12. Select from a list in a list box 120 13. Database utility macros 122 13.1. Quoting table and field names 122 13.2. Convert between an UNO Date and a Basic Date 122 13.3. Convert a result set to an array of data 124 13.4. Create and populate a dialog from a result set 127 14. Tips and tricks 128 14.1. Limit the number of returned records 128 15. Connect to a Base document using JDBC 130
The content started as a book that I intended to write, but then it was dropped, so I created this instead. It is likely too concentrated on macros for the average person. That said, any content can be removed and used. Something of interest with AndrewBase.odt, is that all included macros are included in the document itself and my be run by clicking on buttons in the document.
Note that Drew Jensen probably has much of interest that he could add.
Areas of interest that should likely be covered, in my opinion, include:
What is a database "key"?
Database design deals with what is known as "normal" forms. This is perhaps very advanced, but I have been sent database documents created by users that had no idea how to deal with redundant data. For example, if I have a doll that can have a "body type". The usual method is to create a table that enumerates body types. Each body type has a primary key acting as a unique identifier. I do not repeat all information related to the body type for each doll. Instead, I use the primary key and reference the body type table.
Dealing with one-to-many and many-to-many relationships. Areas of interest include table design, form design, and reports.
There is an entirely new Report writing system in the works, it is very exciting. This should be covered, perhaps as its own chapter.
Using an internal database. Using an external database such as MySQL. Converting from MS Access.
I am tired, and these are without much thought.
06/30/07 Here is my first thought on an outline
- 1 Chapter 1 :Introduction
- 2 Chapter 2: Wizards ( Let OO.o do most of the work. )
- 3 Chapter: 3 Designers ( When you need to do it your way.)
- 4 Chapter 4: Exchanging data
- 5 Chapter 5: Customizing your database ( Macros )
- 6 Appendix I Build the example database
- 7 Appendix II Overview of A Database
- 8 Appendix III Further reading on database design
Chapter 1 :Introduction
How are the sections laid out
o Each section for a Wizard will have a description page for each of the dialog pages. Named the same as the page on screen. o Each section for a Designer will have a description of the tool bars used, dialogs used and embedded wizards used. o Who are you? [ Help them with where to start reading and suggest a different route through the sections ] + I have a Base database ( *.odb file ) and I need to work with it. + I need to create a database, like I have done before with ( XXXX )[Access, FileMaker..] + I need to create a database, like I have with Excel or Calc before. + I think I want a database, but have never used a database manager before
Base window layout
o Menus o Tool bars o Sections o SQL Window
o Tables o Query Definitions o Forms o Reports o What is preview mode? o Using folders to keep things together.
Searches and Filters
o What are the differences between a search and a filter o Searching multiple fields ( And vs Or and stuff ) o Don't forget sorting
Adding and Removing data
o Working in a table data view window o Using Queries for insert / Update / Delete o Working in a form window
Mixing Base with the rest of OO.o
o Overview of data exchange within OO.o o F4 - Has always been there, and is still there - Use it + Add a table to Calc + Add a table to Writer + F4 Even works in Base forms??? # Update a lookup table on the fly
The examples used in the book
o A flat database ( Exercise Log? ) o A relational model ( Contacts?? ) o Advanced features ( [Invoices or Inventory or ??? ] )
This would be just a thumbnail of each database and what from each is shown where. I would strongly recommend that each database should be based on supplied table structures. With a modicum of changes or additions. With the possible exception of the advanced entry. There are a couple of database files on the internet hat would be good candidates for this. There is a good French language database that might be right for here for example. Or the accounting demo built by a company in Australia ( sorry, I am not going to go dig up the urls at this minute..)
I would bet if someone asked they any of these authors would allow their OS offering to have certain pieces dissected for the manual. There is also a POS database for running for a small specialty gift retailer that is fully OS, it is less polished or advanced then the others, but with an update for the new report designer would work quite well.
Also the fact that it is not so advanced might be a benefit, it is advanced enough to demonstrate I think most of what needs to be covered - but not so much so that the reader needs to be a seasoned database developer to follow the structures and methods.
Chapter 2: Wizards ( Let OO.o do most of the work. )
Open database wizard
o Why have a wizard for Open?
Where is my data anyway?
o The default database type. o Connections to external databases + A connection is not the same as an import! o Your address book ( Not really a marriage made in Heaven. )
New Table Wzard
o Working with the table templates. + Create Exercise Log table o Data Types 101 ( Default or HSQL datatypes ) o Key please!
o Getting only a few of many ( Simple selects statements ) o Create Exercise Log queries NOTE - this may be the weakest wizard and I would make this the shortest section - the focus on queries is the designer
o Tables and Queries and SQL - Oh my! ( Why the are the same, and why they aren't ) o Which layout template? + Build Exercise Log Main Form o Seating for two please. ( Adding a sub-form ) + Relations prompt suggestions + Build Contacts Main Form
Report Wizard ( When you need a simple list it's hard to beat, if you can make a query! )
o Tables and Queries and SQL - Oh My! en duex! o It's all in the query. o Chose a layout o Can I make this little change? ( Sure but know the lay of the land ) + Using Styles is THE safest way. + Create Exercise Log report # The report takes one input from the user, the name of a month. It then prints the report for that month of the current year.
Chapter: 3 Designers ( When you need to do it your way.)
o More engines equals more data types ( MySQL, PostgreSQL, MS Access and a host of others ) o Indexes o GUI default values o Default formats
o o + Set up Contacts database
o Design View / SQl View / SQL Direct ( Which one? ) o Working with Queries in Queries o Using Replacement Parameters o Using Aliases o Adding data form multiple tables together ( Joins ) + Why Can't I update the data? o Creating Calculated fields o using aggregate functions o Default built-in functions o Advanced SQL + Unions / Intersections / Exclusions + Case When + Calling Stored Procedures # As column # In Criteria
o Tool bars + Form Design ( Overview ) + Form Controls ( Overview ) + More Controls ( Overview ) o Form Navigator + Dataforms # Content Types # Table # Query # SQL + Control Lists # Moving controls around o Add Field Window o Form Designer Wizards + New Table Grid Control + New Combo Box + New List Box
Chapter 4: Exchanging data
Working with Calc
o Using linked data ranges
Working with Writer
Working with Text files
o Multiple Choices + The TEXT connection type + A TEXT table in an embedded database
Chapter 5: Customizing your database ( Macros )
Appendix I Build the example database
* Flat ( ? ) * Relational 1 ( ?? ) * Relational 2 ( ???
This should be a page or 2 of the steps needed to create any of the example files needed. This would not necessarily be the same as creating a duplicate of the files that would be available for download of the example databases.
These pages would be here for the person that might get a printed copy of the document and not have access to the odb files. For this guy then he has to type it in and limit this to only the items needed for what is described.