![]() |
Datenbank: mssql • Version: 2005 • Zugriff über: win 7
Attach/Dittach DB using Delphi
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:
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)".
CREATE DATABASE [database_name] ON
( FILENAME = 'C:\Program Files....\test.MDF'), ( FILENAME = 'C:\Program Files ....\test_log.LDF') FOR ATTACH ; 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? |
AW: Attach/Dittach DB using Delphi
Hi,
can you put the database to some other folder (progData)? In Program-files folder you don't have write permissions. Best regards Klaus |
AW: Attach/Dittach DB using Delphi
Hi Klaus,
yes, i have tried from another directory(c:\user\public) as well but it has the same problem |
AW: Attach/Dittach DB using Delphi
your user account must have the disk admin server role to attach/detach databases.
The security system of the MS SQL server is quite complex and you need some time to understand it. ![]() The local windows administrator has by default all rights on the SQL server. If you're in the context of an normal windows user account you don't have the rights to create/delete/backup/attach/detach databases. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:40 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz