Creates an UltraLite database.
ul_bool ULCreateDatabase ( SQLCA * sqlca, ul_char * connection-parms, void const * collation, ul_char * creation-parms, void * reserved );
sqlca A pointer to the initialized SQLCA.
connection-parms A semicolon separated string of connection parameters, which are set as keyword value pairs. The connection string must include the name of the database. These parameters are the same set of parameters that may be specified when you connect to a database. For a complete list, see UltraLite connection parameters reference.
The desired collation sequence for the database. You can get a collation sequence by calling the appropriate function. For example:
void const * collation = ULGetCollation_1250LATIN2(); |
The function name is constructed by prefixing the name of the desired collation with ULGetCollation_. For a list of all available collation functions see install-dir\SDK\Include\ulgetcoll.h. You must include this file in programs that call any of the ULGetCollation_ functions.
A semicolon separated string of database creation parameters, which are set as keyword value pairs. For example:
page_size=2048;obfuscate=yes |
For a complete list, see Choosing database creation parameters for UltraLite.
reserved This parameter is reserved for future use.
ul_true Indicates that database was successfully created.
ul_false A detailed error message is defined by the SQLCODE field in the SQLCA. Typically this is caused by an invalid file name or access denial.
The database is created with information provided in two sets of parameters:
Applications can call this function after initializing the SQLCA.
The following code illustrates using ULCreateDatabase to create an UltraLite database as the file C:\myfile.udb.
if( ULCreateDatabase(&sqlca ,UL_TEXT("DBF=C:\myfile.udb;uid=DBA;pwd=sql") ,ULGetCollation_1250LATIN2() ,UL_TEXT("obfuscate=1;page_size=8192") ,NULL) { // success }; |
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |