Bonjour,
je souhaite via programmation access (VBA et fichier *.adp), attacher un fichier *.mdf à un serveur SQL (MSDE local ou autre...).
Quelqu'un connaitraît il la syntaxe avec SQLDMO ?
Merci d'avance pour vos réponses
Bonjour,
je souhaite via programmation access (VBA et fichier *.adp), attacher un fichier *.mdf à un serveur SQL (MSDE local ou autre...).
Quelqu'un connaitraît il la syntaxe avec SQLDMO ?
Merci d'avance pour vos réponses
Syntax
object.AttachDB( DBName , DataFiles ) as String
Parts
object
Expression that evaluates to an object in the Applies To list
DBName
String that specifies an existing database by name
DataFiles
SQL-DMO multistring that specifies operating system files by name
Returns
String indicating success or failure
Prototype (C/C++)
HRESULT AttachDB(SQLDMO_LPCSTR DBName,
SQLDMO_LPCSTR DataFiles,
SQLDMO_LPBSTR pResult);
Remarks
The AttachDB method is used when a change to the location of operating system (OS) files implementing the database must be made visible to an instance of SQL Server.
The DataFiles argument can specify up to 16 OS files. Each file should be specified by complete name, including the path. At least one file in the list of those specified must be the PRIMARY data file. Operating system files implementing storage for the transaction log can be specified.
For more information about setting multistring parameters, see Using SQL-DMO Multistrings.
The AttachDB method fails if more than 16 OS files are specified. When using SQL-DMO to move a database implemented on more than 16 files, use the CreateForAttach property of a Database object.
Making a database visible to an instance of SQL Server by using the AttachDB method requires appropriate permissions. The SQL Server login used for SQLServer object connection must be a member of the system-defined role sysadmin.
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager