Subject: C & C++ API calls - creating a database from a template
Firstly, which C++ which overloaded function are you using?CreateDatabaseFromTemplate( &templatedb, &newdb_path, &newdb_server, *newdb )
CreateDatabaseFromTemplate( &templatedb, &newdb_path, &newdb_server, &options, *newdb );
CreateDatabaseFromTemplate( &templatedb_path, &templatedb_server, &newdb_path, &newdb_server, *newdb );
CreateDatabaseFromTemplate( &templatedb_path, &templatedb_server, &newdb_path, &newdb_server, &options, *newdb );
I’d advise using the last function and specify the DBOptions you need, and its better to be safe than sorry by always populating all parameters. Even if the newdb_server is the same as the templatedb_server, don’t leave it blank and assume that the calling function will do as you expect… supply all data… I’ve learnt this the hard way.
I like doing manual tests in code to ensure everything is moving along smoothly. Try getting the ‘new’ database’s title after creating it. For more info have a look at the C++ sample called ‘copydb’.
And, whenever a function is giving me the @$#%^, I take a deep breath :), open a new compiler instance, and write a quick stand alone EXE that only performs that function and exits.
Hope this helps.
Sean