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 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.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 3.5

COLUMN

Database Bindings

Issue: 3.5 (May/June 2005)
Author: Paul Lefebvre
Author Bio: Paul Lefebvre is President and Chief Software Architect of LogicalVue Software, producers of SQLVue, RBUnit, and other products.
Article Description: No description available.
Article Length (in bytes): 5,758
Starting Page Number: 32
Article Number: 3513
Resource File(s):

Download Icon 3513.zip Updated: 2013-03-11 19:07:58

Related Link(s): None

Excerpt of article text...

By popular demand, I will be covering the topic of database bindings. In general, bindings have been getting some good press lately. They are a way to have an object change its behavior without having to write a lot of code. REALbasic has really good support for bindings. Starting with Panther, Cocoa includes CocoaBindings, which are similar to REALbasic bindings. For a good article on the topic of REALbasic bindings, refer to "Control Binding in REALbasic," by Charles Yeomans in RBDTag by Tim. 1.6.

Database bindings allow you to do things like display, edit, and modify data without having to write any code other than the initial SQL to fetch the data. In order to get started we first need a database to use. Available for download from the RBD web site is a version of the "Northwind" database for the native REAL Database engine. We will use the Northwind database as a data source as we attempt to build a relatively "code-free" UI to manage its information.

Getting Started

First, I want to briefly go over how a binding is created using the REALbasic IDE. A binding can only be created with the mouse, and if you have not done it before it may not be intuitive to you. To try it out, add two controls to a window (a ListBox and a PushButton are good). Now click on the ListBox control and hold down the shift and command keys (control-shift on Windows). While continuing to both click and hold the keys, drag the mouse over the PushButton control. While you're doing this you'll see a line appear. Let go of the mouse button once you are over the other control. If a binding is supported between the two controls, you will get the New Binding dialog asking you to choose the type of binding. For now you just need to know that when I write "create a binding," you should follow the above steps.

Second, please be aware that I will be using REALbasic 5.5 (specifically 5.5.2; I had some difficulty getting bindings to work reliably on Windows with RB 5.5.4) as I write this. Versions of REALbasic prior to 5.5 will not be able to use our sample Northwind database and may or may not work with any examples.

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