DoCmd.TransferSQLDatabase (Access)

Transfers the entire specified Microsoft SQL Server database to another SQL Server database.

The following conditions must be met or else an error occurs:

TransferSQLDatabase (Server, Database, UseTrustedConnection, Login, Password, TransferCopyData)


DoCmd.TransferCompleteSQLDatabase _ 
 Server:="MainOffice", _ 
 Database:="Inventory", _ 
 UseTrustedConnection:=True, _ 
 TransferCopyData:=False 

Arguments

The following arguments are required:

Server (String) - The name of the SQL Server to which the database will be transferred.

Database (Database) - The name of the new database on the specified server.

Optional arguments

The following arguments are optional

UseTrustedConnection (Boolean) - True if the current connection is using a login with system administrator privileges. If this argument is not True, you must specify a login and password in the Login and Password arguments.

Login (String) - The name of a login on the destination server with system administrator privileges. If UseTrustedConnection is True, this argument is ignored.

Password (String) - The password for the login specified in Login. If UseTrustedConnection is True, this argument is ignored.

TransferCopyData (Boolean) - True if all data in the database is transferred to the destination database. If this argument is not True, only the database schema will be transferred.