Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

Article Preview


Buy Now

PDF:

From Scratch

Swatter Part 4

A simple bug database

Issue: 6.5 (July/August 2008)
Author: Brad Rhine
Article Description: No description available.
Article Length (in bytes): 8,090
Starting Page Number: 44
RBD Number: 6516
Resource File(s):

Download Icon 6516.zip Updated: Tuesday, July 1, 2008 at 11:42 AM

Related Link(s): None
Known Limitations: None

Excerpt of article text...

For the last three issues, we've been working on Swatter, our simple bug database. So far, we've written the SQL code to create our databases, we've designed our interface, and we've started tying the interface to the database.

In this issue, we'll add the code that will allow us to add issues for our projects. So, without further ado, let's get to the code.

Listing Our Issues

In MainSwatterWindow, we're going to create a new method called PopulateIssues. The method will have the job of figuring out which project is selected in ProjectBox and then filling IssueBox with that project's issues. Its code will look like this.

Dim SQL As String

Dim RS As RecordSet

Dim ProjectID As Integer

IssueBox.DeleteAllRows

If ProjectBox.ListIndex<>-1 Then

ProjectID=ProjectBox.CellTag(ProjectBox.ListIndex,0)

SQL="select entry_date, title, issue_type, severity, id from issues where project_id="+Str(ProjectID)

If SwatterDB.Connect() Then

RS=SwatterDB.SQLSelect(SQL)

If RS<>Nil Then

While Not RS.EOF

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

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com