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:
If you omit the encryption constant, an unencrypted database is created. You can specify only one version constant. If you omit a version constant, a database that uses the Microsoft Jet database version 3.0 is created.
CAUTION If a database is not encrypted, it is possible, even if you implement user/password security, to directly read the binary disk file that constitutes the database.
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 Overview | Class Members | Hierarchy Chart
See Also CDaoDatabase::CDaoDatabase