[VXCMD] Newbie Really basic ObjectPtr question...

Rodney Tamblyn rodneytamblyn at paradise.net.nz
Tue Feb 11 19:55:07 CST 2003


I've written a simple MC stack which traverses a directory of files and 
imports these into a valentina database.  This part is working fine.

I'd like to use ObjectPtr fields to relate images and other blobs in 
the Media table to specific records in the Content table, allowing many 
to one relationship.

First I create two tables "Content" and "Media"

In the Media table I define blob flds for images, thumbnails, movies, 
etc
In the Content table I define a variety of fields, including 3 
ObjectPtr flds pointing at the Media table:  ImagePtr, ThumbPtr, 
MoviePtr

To create these flds I use:

get Valentina( "BaseObject_MakeNewField", boContentRef, "ImagePtr", 
"ObjectPtr", boMediaRef, 1 )

Now, imagine I have come to the point where I wish to add a reference 
to a particular image (let's say it's the first record in the Media DB) 
to a record in the Content table.  How do I do this?
I wonder if you use Cursor_GetFieldRef( CursorRef, fldNameOrIndex ) to 
get a reference to the desired image in the Media table, then set the 
ImagePtr fld of the Content table to this?

It's not clear to me from the  documentation, either VXCMDReference or 
ValentinaKernal how to actually establish this relationship.

Thanks for help and suggestions....

Regards,

Rodney 



More information about the Valentina mailing list