Why does this not work anymore in version 3.5.2?
Matthew Jew
mjew at icnc.com
Tue May 13 19:50:42 CDT 2008
Hello,
This code segment is an abbreviated version of what one used to do to
create a new database.
It was how it was done in version 2.5.8:
ValentinaInit( 4 * 1024 * 1024 );
VSQL::I_SqlDatabase_Ptr pSqlDb = CreateSqlDatabase( kStorage_Disk );
FBL::I_Database_Ptr pFblDb = pSqlDb->get_BaseDatabase();
// STEP: create database.
I_Location_Ptr pLocation = CreateDiskLocation( "test_db" );
pFblDb->put_Location( pLocation );
pFblDb->Create();
// STEP: create Person table.
I_Table_Ptr pTable = pFblDb->CreateTable( "Person" );
// STEP: create two fields.
I_Field_Ptr pf1 = CreateLongField( pTable, "fld_Long" );
I_Field_Ptr pf2 = CreateStringField( pTable, "fld_String", 20 );
//ViewFieldsCount( pTable );
// STEP: delete fld_String field from Person.
pTable->DropField( pf2 );
//ViewFieldsCount( pTable );
// STEP: close database.
pFblDb->Close();
ValentinaShutDown();
This code does not work for me in version 3.5.2.
The application crashes with this error:
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000000
at
0 libvshared_fat_release.dylib 0x01c2e144 fbl::CreateNumericField
(fbl::smart_ptr<fbl::I_Table>, fbl::String const&, unsigned long,
unsigned short, fbl::String const&) + 272
1 ...inaTest3WindowController.ob 0x0002df84 fbl::CreateLongField
(fbl::smart_ptr<fbl::I_Table>, fbl::String const&, unsigned short,
fbl::String const&) + 116 (FBL_Algs_Table.h:115)
I am somewhat at a loss as to how I am supposed to create or open a
database in version 3.5.2
if the above code does not work.
BTW, the code was essentially copied from the current (version 3.5.2)
VSDK_Example code,
which makes it especially disturbing to me that it does not work.
- Matthew
More information about the Valentina
mailing list