questions about VNET

SoftIl softil at onlinehome.de
Tue Oct 14 12:37:07 CDT 2003


Hi Ruslan,
2 Problems:

1.)
I get an exception if I set an field "unique" after I created it in an existing table. If I do the same if I created the hole tablen ew, then it works fine.
If I set the field "index" there are no problemes.
Example:

_table = _db.CreateTable(tablename);
_myField = _table.CreateField("key",VNET.FieldType.kUShort);
_myField.SetIsIndexd(true);   
_myField.SetIsUnique(true);     --- It works fine.


_table = _db.GetTable(tablename);
_myField = _table.CreateField("key",VNET.FieldType.kUShort);
_myField.SetIsIndexd(true);   
_myField.SetIsUnique(true);     --- I get an exception  "An external component has released an exception."

But the field is correct created and it is indexd and unique.

if I do this, I can work with it, but it isn't a very nice way. ;-):

try
{
_myField.SetIsUnique(true);    
}
catch
{}


2.)
How can I check, if an VNET-object validly or not?
Example:

I create an field:
_myField = _table.CreateField("key",VNET.FieldType.kUShort);and I get an object from type VNET.VField return.

But in case the operation wasn't successfully, then I get an empty object return (the internal property _field = null).
Only if the operation successfully, then I get an valid object return and the internal property _field has an value <> null.
How can I check the object? If I do this "_myField == null" I get always false.

That's the same with all other objects (databaseobject,...).

Thanks for your answer
Carsten


More information about the Valentina mailing list