Lots of beginner questions

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Oct 21 02:33:02 CDT 2003


on 10/21/03 0:55, chuck hinkle at chuckbo at hinkles.us wrote:

Hi Chuck,

> I have the feeling that I'm not doing things right.
> 
> 
> 1) I've looked at the Vapp to build the database, but I don't see where I
> can go to set properties such as segmentsize and encryption. Does that have
> to be done in the RB program?

I think it is always good idea to make code in program code that create db.
This will allow you create fresh empty db a lots of times if needed.

NOTE: Properties your mention VAPP cannot manage.
But Valentina Studio can.


> 2) Even in VB, I was surprised that these properties didn't show up as
> properties. I see that if I reference the database in code, I can access
> these properties. Does this imply that I should create a small program that
> I can run one time to set the properties of the database I create before
> distributing my application?

You can do in this way.

But also look on V4RB Example1.
User choose menu File->New...
Point where to put database and now is called function that create db with
needed tables and fields.
Very easy I think.

Or you can make app that on start check its folder and if there is no db
then create it using that function.


> 3) I've been adding the statements in RB that define the tables and fields
> (as described in the REALbasic tutorial document. I'm less confident that
> I'm doing this right. Do these field constructors only need to be run one
> time, when the database is created? That takes me back to the question about
> having a separate program to prepare my database to ship instead of
> including all of this code in the RB app.
> 
> Note that it is meaningless for someone to start with an empty database with
> this app; it requires a shipped database with several thousands of records
> preloaded.

Not once.

You make hierarchy of objects.
    myDatabase
        tables
            fields.


No before Create() or before Open() existed db you do ONE LINE OF CODE

    db = new myDatabase

This line of code calls the cascade of constructors and create in RAM all
needed objects.

Now you can say

    db.Create() or db.Open()


> 4) Fred said that he prefers using the Vapp to build the schema. After that,
> would you run a special program to open up the database and set the
> properties such as encryption one time?

Not special program.
I think Fred do not use encryption.

BTW, please note, since you just start with Valentina then do not try play
with all params at once! :-)

Do step by step. At first use default params of Valentina.
Only if you will have sure that you need change something then only optimize
your app.


> 5) If you use the Vapp to define the schema, how do all of the database and
> table classes, and their properties, get built in the RB project? Do you
> still hae to build those, but you don't have to build all of the field
> constructors?

Note, V4RB can work in 2 ways: with classes or with NO classes.
And you need choose what you like more.

If db is created in VAPP then there is no way to use classes.

Then you need work in this way:


    db = new Vdatabase()   // note, not myDatabase, but Vdatabase

    db.open()


    // now you can do
    dim boPerson as VBaseObject
    boPerson = db.BaseObject( "Person" )

    fldName = boPerson.Field( "Name" )


And so on.

Or even simpler:

    curs = db.SqlSelect( "something here" )

    curs.Field( "Name" ).GetString()

And so on. I.e. Work via cursors.

Valentina give you several ways.
Again, all up to your favor.


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list