The CreateForAttach property controls database file creation when the Database object is added to the Databases collection of a connected SQLServer object.
object.CreateForAttach [= value]
object
Expression that evaluates to an object in the Applies To list
value
TRUE or FALSE
Boolean
Read/write
HRESULT GetCreateForAttach(LPBOOL pRetVal);
HRESULT SetCreateForAttach(BOOL NewValue);
If TRUE, the database is created from files specified in the FileGroups and LogFiles collections.
If FALSE, data files are created as directed by the FileGroups and LogFiles collections.
Creating databases from existing data files is constrained. For more information, see CREATE DATABASE.
Note CreateForAttach can only be set when the database is initially created.