Einzelnen Beitrag anzeigen

question

Registriert seit: 17. Apr 2013
97 Beiträge
 
#1

Attach/Dittach DB using Delphi

  Alt 4. Dez 2013, 10:51
Datenbank: mssql • Version: 2005 • Zugriff über: win 7
Hi,
I have created a button called "DBAttached" using delphi and i would like to attached a MSSQL DB by clicking on this button. i am using the following query
Code:
CREATE DATABASE [database_name] ON
( FILENAME = 'C:\Program Files....\test.MDF'),
( FILENAME = 'C:\Program Files ....\test_log.LDF')
 FOR ATTACH ;
but when i run the program and click on the button , i get the error "test.MDF" kann nicht geöffnet werden. Betriebssystemfehler 5: "5(Zugriff verweigert)".
if i run the SQL server management studio as a administrator, then i can attached/dittached any DB using SQL server management studio only,
but how i can do the same using delphi as well?
  Mit Zitat antworten Zitat