Greetings, DB Questions

Hi Everyone,

New guy here. Been programming for about 25 years, current programming environments include .NET/C#, Python and Delphi (mainly legacy maintenance). I’m currently evaluating new tools for cross-platform development, and I just discovered Xojo last week. So far, I REALLY like what I see. I’ve gone through all the available Xojo documentation (online, PDFs, etc.) and have spent hours reading the discussion forum. You folks seem like a nice, knowledgeable bunch of people (can’t say that for other developer forums)!

I have some questions regarding the database development aspect of Xojo. I’m a long-time Firebird DB user/developer, so I’ll be using Firebird for this project. I installed the Firebird plug-in from MonkeyBread, and I can query my existing Firebird DBs without problem on both Win7 and OSX Mountain Lion (I prefer my iMac for development).

On to the questions:

  1. Based on everything I’ve read about Xojo thus far, it seems that using the DataControl is frowned upon. Is this indeed the general consensus? If so, not a problem - I’ve managed to manually code my DB connection, queries, etc.

  2. I see that Xojo has no data grid. I was concerned at first, but after playing with the list box component, it appears that the lack of a true data-aware data grid won’t be a problem for me. However, there doesn’t appear to be a VCR-style button bar component to control movement through a list box. I’ve made a weak attempt to try to code something to mimic this functionality, but haven’t had any luck. Is this possible?

  3. The Xojo DB license is unclear to me. With Firebird and the MonkeyBread plug-in, do I still need to purchase a Xojo DB license?

  4. Is there a 3rd party ORM DB framework for Xojo? I don’t mind writing raw SQL, but I’m accustomed to using ORMs like SQLAlchemy (Python) and the ORM built into the Web2py Python framework.

  5. Finally, regarding the listbox and the recordset component, I found the code in the docs that populate a listbox from a recordset. But there’s obviously a disconnect between the listbox and the recordset, as the recordset has only been copied into the listbox. Anyhow, I haven’t found any example code that shows editing of the listbox, and then posting back to the recordset/database. Is this possible? Do I need to keep the listbox and recordset “in sync” somehow? Yes, my users will want to edit inside the grid for this particular application.

Thanks to all who reply!

[quote=28939:@Alex Sharp]Hi Everyone,

New guy here. Been programming for about 25 years, current programming environments include .NET/C#, Python and Delphi (mainly legacy maintenance). I’m currently evaluating new tools for cross-platform development, and I just discovered Xojo last week. So far, I REALLY like what I see. I’ve gone through all the available Xojo documentation (online, PDFs, etc.) and have spent hours reading the discussion forum. You folks seem like a nice, knowledgeable bunch of people (can’t say that for other developer forums)!

I have some questions regarding the database development aspect of Xojo. I’m a long-time Firebird DB user/developer, so I’ll be using Firebird for this project. I installed the Firebird plug-in from MonkeyBread, and I can query my existing Firebird DBs without problem on both Win7 and OSX Mountain Lion (I prefer my iMac for development).

On to the questions:

  1. Based on everything I’ve read about Xojo thus far, it seems that using the DataControl is frowned upon. Is this indeed the general consensus? If so, not a problem - I’ve managed to manually code my DB connection, queries, etc.
    [/quote]
    Yes - what little it gives you you can, as you’ve discovered, replace very easily

Certainly - usually most people start with a canvas & in its Paint event they draw the control
Look in the samples in Desktop > Custom Controls & you’ll get some ideas on how to do this sort of thing

I’m honestly not sure if you do
You can try building an application & if it’s required you would get a warning about not having one.

The only one I know of off the top of my head is from Bkeeney software - Active Record

The easiest thing would be to put the primary key for the record in the rowtag of each row
Then when a person edits a row you can grab the data & using the primary put it back in the DB

I’d stay away from it as it is really for simple usage and demos.

You should be able to create something like this using a ContainerControl. Layout the ContainerControl with the buttons you need and then allow a ListBox to be assigned to it via a property. Then the ContainerControl buttons can move the row in the ListBox accordingly.

If it uses our native database API then it will require a DB license. If it does not then, I don’t know. It depends on how the plugin is set up.

BKeeney Software has ActiveRecord: http://www.bkeeney.com/rbinto/activerecord/

I also created Storm before I started at Xojo: http://storm.logicalvue.com

The RecordSet will not be directly aware of the ListBox. Typically, you would store the PrimaryKey of the RecordSet row in the RowTag for the ListBox. After a row is edited, you would use the PK to update the row in the DB.

RecordSet is use once and throw away. Keep the data you need stored elsewhere, like in the listbox. Once you have the data from the database, updating it is a completely separate operation.

Look also at: http://forums.realsoftware.com/viewtopic.php?f=3&t=4342

Thanks everyone! Regarding the VCR-style navigation through a listbox, I’ve figured it out.

Maybe this one could help you:
Realbasic DOM Wizard 2009