Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 16 in printed book and digital formats -- plus a one-year subscription (beginning with 17.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 6.4

COLUMN

Swatter Part 3

A simple bug database

Issue: 6.4 (May/June 2008)
Author: Brad Rhine
Author Bio: Brad Rhine is the developer of Kodiak, a complete student information system written entirely in REALbasic. That's his day job. In his spare time, he writes shareware applications in REALbasic.
Article Description: No description available.
Article Length (in bytes): 17,164
Starting Page Number: 38
Article Number: 6414
Resource File(s):

Download Icon 6414.zip Updated: 2008-05-15 11:17:49

Related Link(s): None

Excerpt of article text...

In the past two issues, we've created our database schema and roughed in our interface for Swatter, our simple bug database. In this issue, we'll completely change gears and start something new.

No, I'm just kidding. I wouldn't leave you hanging like that. Not with all these bugs to be fixed. In this issue, we'll start getting the database and the interface to work together.

Let's Start At The Very Beginning

It's a very good place to start. The very first thing that Swatter needs to do when it launches is connect to our database. For this series of articles, we'll be using the built-in REAL SQL Database, so all our database connection code will relate to that. If you'd prefer to use a different database, or even a multi-user database, this part will be different (other parts of the code may also need minor changes as well). If you haven't already done so, drag your database scheme files (CreateProjectsTable, CreateIssuesTable, and CreateUsersTable) into your REALbasic project.

Create a module called DatabaseManager. We'll use this module to manage our database, hence the name, The first thing we're to do in DatabaseManager is add a property: SwatterDB as REALSQLDatabase. Make this property global (note that this could also be public in scope, but since we'll be accessing it pretty often in our code, making it global can save us some typing later on). SwatterDB will be our reference to the database throughout our entire application.

...End of Excerpt. Please purchase the magazine to read the full article.