| | |
MS SQL Permission on IIS 6
Please support our MS SQL advertiser: Intel Parallel Studio Home
![]() |
Hello everyone,i wrote an application that makes database backups and zips them.
Can anyone please tell me what i need to do in order to get the apllication to work on IIS 6 windows server 2003 SQL 05
1. The application works fine on machines for both XP and VISTA.
2. The application runs fine on Win Server 2003 however :
my problem is : obviously the database is in use by the web site.
How can i give my application permission to make the backup while the website is connected to the database ?
regards,
Delphi & C# programmer deluxe...
You need to issue a backup command to the SQL Server and then archive the .bak file. You never want to access the .mdf and .ldf files directly.
Use this query:
Note: The file path is relative to the machine running the SQL Server, not the client issuing the command
Use this query:
BACKUP DATABASE [DBName] TO DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL\BackUpManual\DBName.bak' WITH INIT , NOUNLOAD , NAME = N'DBName backup', NOSKIP , STATS = 10, NOFORMAT
Note: The file path is relative to the machine running the SQL Server, not the client issuing the command
Hi my friend , i have that .
PS the DBhandler.DbWinHandler is just a class we use to connect to SQL.
should i add any of the following ?
INIT ,
NOUNLOAD
NOSKIP ,
STATS = 10,
NOFORMAT
????
SQL Syntax (Toggle Plain Text)
/// <summary> /// Backups are done here /// </summary> #region Backup Methods #region Full Backup method void Fullbackup() { method = "Full"; // Creating connection Username = txtUsername.TEXT; Password = txtPassword.TEXT; // specifying connection string DBhandler.DbWinHandler dbHandler = new DBhandler.DbWinHandler("Data Source=" + txtServerName.TEXT + ";Initial Catalog=master;Persist Security Info=True;User ID=" + Username + ";Password=" + Password); // Getting the items that has to be backed up foreach (string lstItem IN listBoxControl2.Items) { dbName = lstItem; if (!Directory.EXISTS(textEdit1.TEXT + "/DataSafe Backups/Temp/")) { DirectoryInfo newDir = new DirectoryInfo(textEdit1.TEXT + "/DataSafe Backups/Temp/"); newDir.CREATE(); } lblStatus.TEXT = "Backing up " + dbName; lblStatus.Refresh(); dbHandler.SmartGetDataSet("BACKUP DATABASE " + dbName + " TO DISK = '" + textEdit1.TEXT + "/DataSafe Backups/Temp/" + dbName + ".bak' WITH NAME = '" + dbName + ".bak'"); ZipFile(); } } #endregion #region Differential Backup method void Diffbackup() { method = "Diff"; // Creating connection Username = txtUsername.TEXT; Password = txtPassword.TEXT; // specifying connection string DBhandler.DbWinHandler dbHandler = new DBhandler.DbWinHandler("Data Source=" + txtServerName.TEXT + ";Initial Catalog=master;Persist Security Info=True;User ID=" + Username + ";Password=" + Password); // Getting the items that has to be backed up foreach (string lstItem IN listBoxControl2.Items) { dbName = lstItem; if (!Directory.EXISTS(textEdit1.TEXT + "/DataSafe Backups/Temp/")) { DirectoryInfo newDir = new DirectoryInfo(textEdit1.TEXT + "/DataSafe Backups/Temp/"); newDir.CREATE(); } lblStatus.TEXT = "Backing up " + dbName; lblStatus.Refresh(); dbHandler.SmartGetDataSet("BACKUP DATABASE " + dbName + " TO DISK = '" + textEdit1.TEXT + "/DataSafe Backups/Temp/" + dbName + "_Differential.bak' WITH DIFFERENTIAL, NAME = '" + dbName + ".bak'"); ZipFile(); } } #endregion #region LOG backup method void Logbackup() { method = "Log"; // Creating connection Username = txtUsername.TEXT; Password = txtPassword.TEXT; // specifying connection string DBhandler.DbWinHandler dbHandler = new DBhandler.DbWinHandler("Data Source=" + txtServerName.TEXT + ";Initial Catalog=master;Persist Security Info=True;User ID=" + Username + ";Password=" + Password); // Getting the items that has to be backed up foreach (string lstItem IN listBoxControl2.Items) { dbName = lstItem; if (!Directory.EXISTS(textEdit1.TEXT + "/DataSafe Backups/Temp/")) { DirectoryInfo newDir = new DirectoryInfo(textEdit1.TEXT + "/DataSafe Backups/Temp/"); newDir.CREATE(); } lblStatus.TEXT = "Backing up " + dbName; lblStatus.Refresh(); dbHandler.ExecuteCommand("BACKUP LOG " + dbName + " TO DISK = '" + textEdit1.TEXT + "/DataSafe Backups/Temp/" + dbName + "_LOG.bak' WITH NAME = '" + dbName + ".bak'"); ZipFile(); } } #endregion #endregion
PS the DBhandler.DbWinHandler is just a class we use to connect to SQL.
should i add any of the following ?
INIT ,
NOUNLOAD
NOSKIP ,
STATS = 10,
NOFORMAT
????
Last edited by cVz; Sep 11th, 2009 at 7:40 am.
Delphi & C# programmer deluxe...
![]() |
Similar Threads
- Which OS do you suggest? (IT Professionals' Lounge)
- ASP + Microsoft OLE DB Provider for SQL Server error '80004005' (ASP)
- Urgent Help With a SQL Where statement (MS SQL)
- C#/ASP.Net Developer Needed (Web Development Job Offers)
- how to show OLAP Reports in Crystal Reports in a ASP Page with Drill down option (ASP)
- IIS, the three little letters I hate.... (ASP.NET)
- PHP, ASP, ColdFusion, what's your fav? (IT Professionals' Lounge)
- Do I really need an sql server (ASP)
Other Threads in the MS SQL Forum
- Previous Thread: SQL Query Problem
- Next Thread: Simultaneous Data Update - "Record Locking"
| Thread Tools | Search this Thread |
.net 2005 access acquisition add age amd array asp asp.net assignment avatar aws backup bigbrother bluegene breach business c# chips computing connectingtodatabaseinuse connection daniweb database databaseconnection datagridview dataset development dos dynamic ecommerce economy energy enterprise enterprisesoftware hacker hardware hp ibm ibm.news iis images intelibm java javascript.cms linux list map medicine memory microsoft mssql mssqlserver2005andasp myregfun mysql news openoffice opensource operatingsystem oracle pc permission php problem properties ps3 recession record redhat restore russia search security server servlet simpledb single sql sqlite sqlserver sqlserver2005 sqlserverconnection sun supercomputer supercomputing survey table technology trends ubuntu uk update vb vb.net vista visualstudio win32api working x86







