skip to main content
Part 2: The 32-Bit/64-Bit Drivers : The SQL Server Legacy Wire Protocol Driver : Connection Option Descriptions : AttachDBFileName
  
AttachDBFileName
Attribute
AttachDBFileName
Purpose
The name of the primary file of an attachable database.
Valid Values
string
where:
string
is name of the primary file of an attachable database.
Include the full path and escape any slash ( \ ) characters if using a C character string variable:
AttachDBFileName=C:\\MyFolder\\MyDB.mdf
This database is attached and becomes the default database for the connection. To use AttachDBFileName, you must also specify the database name in either the SQLDriverConnnect DATABASE parameter or the SQL_COPT_CURRENT_CATALOG connection attribute. If the database was previously attached, Microsoft SQL Server will not reattach it; it will use the attached database as the default for the connection.
Default
None
GUI Tab
n/a