Article Preview
Buy Now
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):
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.