Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - C and C++ Programming » UltraLite C/C++ Common API Reference

MLFileTransfer function Next Page

ULCreateDatabase function


Creates an UltraLite database.

Syntax

ul_bool ULCreateDatabase ( SQLCA * sqlca,
ul_char * connection-parms,
void const * collation,
ul_char * creation-parms,
void * reserved
);

Parameters

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 String Parameters Reference.

collation    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\h\ulgetcoll.h. You must include this file in programs that call any of the ULGetCollation_ functions.

creation-parms    A semicolon separated string of connection parameters, which are set as keyword value pairs. For example:

page_size=2048;obfuscate=yes

For a complete list, see Choosing creation-time database properties for UltraLite.

reserved    This parameter is reserved for future use.

Returns
Remarks

The database is created with information provided in two sets of parameters:

Applications can call this function after initializing the SQLCA.

Example

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
  };