Hacker ...
A person who enjoys exploring the details of programmable systems and how to stretch their capabilities, as opposed to most users, who prefer to learn only the minimum necessary. - Jargon File


Steven Cholerton Picture

“The supreme accomplishment is to blur the line between work and play.” - Arnold Toynbee

I have been designing and developing computer software solutions for over 20 years. I am a Chartered IT Professional awarded by the British Computer Society and a Fellow of the Institution of Analysts and Programmers.

Currently I run my own Software Development and Computer Consultancy company. In addition I also run Arten Books which provides new and used discount books through the Amazon Marketplace.

I am a Motorcycle fan, an avid reader of sci-fi, fantasy, history, thrillers and technical books, a guitar player, a traveller and a father.

In addition I have a special interest in ancient cultures, their technologies and beliefs, such as the Egyptians, the Aztecs, the Greeks and the Romans.

In September 2009 one of my products R10Cipher: Email, Text and File Security, was shortlisted as a Finalist for the 2009 Information Security Product of the Year award.

Contact Details:
stevecholerton@mac.com

as_red_blue_tp200

Arten Science

r10.tel

Twitter

Linked In


Hacker ...
A person who enjoys exploring the details of programmable systems and how to stretch their capabilities, as opposed to most users, who prefer to learn only the minimum necessary. - Jargon File


Steven Cholerton Picture

“The supreme accomplishment is to blur the line between work and play.” - Arnold Toynbee

I have been designing and developing computer software solutions for over 20 years. I am a Chartered IT Professional awarded by the British Computer Society and a Fellow of the Institution of Analysts and Programmers.

Currently I run my own Software Development and Computer Consultancy company. In addition I also run Arten Books which provides new and used discount books through the Amazon Marketplace.

I am a Motorcycle fan, an avid reader of sci-fi, fantasy, history, thrillers and technical books, a guitar player, a traveller and a father.

In addition I have a special interest in ancient cultures, their technologies and beliefs, such as the Egyptians, the Aztecs, the Greeks and the Romans.

In September 2009 one of my products R10Cipher: Email, Text and File Security, was shortlisted as a Finalist for the 2009 Information Security Product of the Year award.

Contact Details:
stevecholerton@mac.com

as_red_blue_tp200

Arten Science

r10.tel

Twitter

Linked In


REALbasic Built in Database Tutorial Part 1

Introduction

REALbasic comes with build in support for the REALsql database which is basically a single user version of SQLite. This is ideal for use as a local cache for preferences information, window settings etc. It is also useful for so much more.

In this, the first of a series of tutorial posts I will present ideas and code for utilising the database from within REALbasic. I don’t suggest this is the only way or the best way - but it works and works well.

When writing database applications I try and support multiple databases. To ensure that the code for each is optimised to that particular database I generally design this as follows:

First I setup a property that tells me which database I have chosen to work with. For the purposes of this tutorial we will setup this property against the Application and refer to it as App.pDatabase.

I also setup a pair of modules:

mDBWhich
mDBSQLite


When a database access is required, for example a ‘Save’ button is pressed on a Form, the simplified sequence of events looks like this:

Form
mDBWhich.SaveCustomer(
parameters)

mDBWhich.SaveCustomer
Select Case App.pDatabase
Case ‘SQLite’
mDBSQlite.SaveCustomer(
parameters)
Case’Oracle’
.
.
.
End Select

One advantage of this method is that your form knows nothing about your database so if and when you decide to add support for an additional database to your application it is necessary only to add additional switching to the mDBWhich module and create a new module for your new database. There is no need for your GUI to be altered.

We’ll see some real examples of this in action in later posts, but for know bear it in mind but don’t worry about it. All will become clear. In the next post I will show you how to create a database, populate it with tables and indexes and populate them with some default data. All ‘on the fly’ from REALbasic.

Any feedback, good, bad, indifferent and also any suggestions for what you would like to see covered - leave a comment or drop me an email to stevecholerton@mac.com

RSS Feed: http://feeds2.feedburner.com/Lonelyhacker

© 2009 Steve Cholerton Contact Me