CDaoDatabase::Create

virtual void Create( LPCTSTR lpszName, LPCTSTR lpszLocale = dbLangGeneral, int dwOptions = 0 );
throw( CDaoException, CMemoryException );

Parameters

lpszName

A string expression that is the name of the database file that you are creating. It can be the full path and filename, such as “C:\\MYDB.MDB”. You must supply a name. If you do not supply a filename extension, .MDB is appended. If your network supports the uniform naming convention (UNC), you can also specify a network path, such as “\\\\MYSERVER\\MYSHARE\\MYDIR\\MYDB”. Only Microsoft Jet (.MDB) database files can be created using this member function. (Double backslashes are required in string literals because “\” is the C++ escape character.)

lpszLocale

A string expression used to specify collating order for creating the database. The default value is dbLangGeneral. Possible values are:

dwOptions

An integer that indicates one or more options. Possible values are:

Remarks

To create a new Microsoft Jet (.MDB) database, call this member function after you construct a CDaoDatabase object. Create creates the database file and the underlying DAO database object and initializes the C++ object. The object is appended to the associated workspace’s Databases collection. The database object is in an open state; do not call Open after Create.

Note   With Create, you can create only Microsoft Jet (.MDB) databases. You cannot create ISAM databases or ODBC databases.

For information about databases, see the article DAO Database in Visual C++ Programmer's Guide. For related information, see the topic "CreateDatabase Method" in DAO Help.

CDaoDatabase OverviewClass MembersHierarchy Chart

See Also   CDaoDatabase::CDaoDatabase