Newbie alert - Creating databases in Lingo

michael geary listmail at gearyweb.com
Sat Apr 12 19:13:37 CDT 2003


heyadoon Zac,

Just to make sure, you aren't asking how to make a non-Xtra, Lingo-only 
database, right? You are asking how to construct a Valentina database 
without having some sort of SQL dump or XML file, yes?

This is certainly possible, but I have found a number of reasons NOT to 
have my "primary" database definition be a Valentina database. These 
reasons include:

* It's a pain to change Lingo code if your database structure changes
* Valentina is fast and very useful, but I have had corruption problems 
occasionally
* It isn't super easy to get Valentina data into other database formats
* It is practically impossible (right now) to have multiple users enter 
data into a Valentina database.

I have had great results by having my master database be a MySQL 
database on one of my servers. It is then always accessible, multiple 
users can add data (or even modify structure), and with tools like 
PHPmyAdmin, it is very easy to migrate and archive.

What I have done is build a PHP script which will render any MySQL 
database into an XML format. I then have a generic Director movie which 
will request this XML data and construct a Valentina database. If I'm 
running on a local network, I can create a Valentina database with tens 
of thousands of records in just a few minutes, depending on how much 
data is in the records.

To get back to answering your question, some of the key routines in my 
Director movie use the Xtra calls:

set thisTable = MakeNewBaseObject(gMyDataBase,tableName)
set thisField = AddField(gMyDataBase, thisTable, colName, newType)
or
set thisField = AddField(gMyDataBase, thisTable, colName, newType, 
SetField(gCursor,fieldName,fieldData)
AddRecord(gCursor)


I'd offer you my Director movie, but then I'd have to make it available 
to everyone, and I've applied to do a workshop at the MAX (was UCON) 
conference here in Utah in November on Director and Databases, and I 
want to keep some of these tools as giveaways to spice up my 
presentation.

Oh, yeah. And there are some idiosyncrasies that I need to file down.

ANYway, if you need tips, drop a line.

-michael



On Saturday, April 12, 2003, at 06:40 PM, Zav - Alex Zavatone wrote:

> Hi guys.  It's been a long time since I've personally done any 
> database stuff in Director and it's my first time with Valentina.
>
> I'm currently trying to get my brain around the process of creating a 
> database solely in Lingo and don't understand why files are needed to 
> describe the database.  Hopefully, I can figure out how to create my 
> first database completely in Lingo.
>
> The database structure would consist of one table and 3 string fields, 
> username, password, and hint.
>
> I'm going to go through the archives but could anyone point me in the 
> right direction to get going?  I've got the docs right in front of me 
> for reference.
>
> Thanks, this has been a major stopping point for me in my current 
> project.


More information about the Valentina mailing list