SQL SERVER 2005 Automatic Schedule Backup Working not Properly - c#

I am having a web server with install of WINDOWS 2003 Server and SQL SERVER 2005 Currently and i try to do a job schedule with the use of some control that i created. every thing is working properly but when it starts the job (in job i have written T-SQL Command for Backup Database) it will gives following error. i already check that i got the root directory path. and i have all the permission on that folder and i am as a DBOWNER of my database. but still i got error if any one or any person having idea regarding my error please help me immideately. please
****I am here gives path that is root directory of my Application ok****
MY ERROR :
Cannot open backup device 'C:\Inetpub\httpdocs\Full_BackUp_at21032009_092140AM.bak'. Device error or device off-line. See the SQL Server error log for more details. BACKUP DATABASE is terminating abnormally.
So, Please Help me if you having any ideas regarding why this error cause then if u wish to send solution directly me on this mail id : divyeshnh#gmail.com
Thank you
Sorry But I have whole rights that i wants at the root directory because i save my image files into this directory . so, you can understand that i have the rights.
Thank you for reply
i also do another thing :
i read yr answer very carefully & study all the things that u previously say. after that i try another thing that is i place that code on one button click event and fortunately i got success. so, i ask you when i try to do with schedule it will raised me an error while i click on button & take backup it will work fine. so, please give me answer about this.
Thank you for your reply
Thanks

Do the accounts used by SQL Server and Agent services have permissions to access the C:\Inetpub\httpdocs folder?

Are all the folders you your path already created? I think they have to already exist or you'll get an error.

Related

Cannot open database "ASPState" requested by the login. The login failed. Login failed for user 'xxxx'

I am working on one project which is in Asp.Net web form and Sql server. When I run application I get the error Unable to connect Sql Server Session Database and inner exception is Cannot open database ASPState requested by the login.
I did some google search to fix this issue. I don't have sa password so i cannot logged in as sa to assign privileges to ASPState database for the newly created User.
I don't see any ASPState database on Sql Server when i logged in. So i thought I might need to run aspnet reg exe on my machine. So i tried to run aspnetreg_regsql.exe but i got the following error.
An error occurred during the execution of the SQL file
'InstallCommon.sql'. The SQL error number is 5170 and the SqlException
message is: Cannot create file 'C:\Program Files\Microsoft SQL
Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\aspnetdb.mdf' because it
already exists. Change the file path or the file name, and retry the
operation.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Creating the aspnetdb database...
I am totally blank now to solve this issue, I will really appreciate your suggestion for this. This issue hold to publish on production.
Dont think that there is a simple answer to this with the permissions that you have, I think that what has happened is that the database HAS been created, but the user you are using does not have any access to it at all.
Without having an administrators credentials I dont think that you will be able to resolve the problem.
You can however work around it by re-creating the database with a different name:
aspnet_regsql -d[YourNewDBName] -RestOfYourParamaters
That should allow you to re-run the creation script, however there is no guarantee that you wont end up with the same issue on the newly created database.
You should issue the command DROP DATABASE aspnetdb and then re-run your script.
'InstallCommon.sql' surely ain't any database. It must be a script that installs a new Database, as the name suggests. Run the script, and then link the generated database

c# window application system.data.oledb.oledbexception operation must use an updateable query

I have made a window application that works very well when i ran through but after creating its setup it is throwing below mentioned exception. I have try to give full access to the database file but still it is not working.
system.data.oledb.oledbexception operation must use an updateable.
query
i am using window 7 and installation folder is c:\program files\abc\ and access db is in same folder. Is this any issue of permissions? Please assist me to remove this exception.
There can be some permission issue just refer this Link
http://www.mikesdotnetting.com/Article/74/Solving-the-Operation-Must-Use-An-Updateable-Query-error
Make sure the ASPNET account (or whatever account is in use at the time) has
Change permissions to the directory where the .mdb file is located. Access
needs to write some temp and locking files during the operation.

User does not exist in MySQL , c# and asp.NET MVC

I am working on development machine without making any user account [i have three of four account who comes when i installed them].
so i open the connection everywhere by a globals variable who hold the connectionstring off-course value of variable can not be changed it's constant.
i open the connection using root account who come by default in mysql server. they work fine everywhere.
but my code try to run a command then server return the error that
The user specified as a definer ('admin'#'localhost') does not exist
i don't know why i got this error even in debug i found that connection open by root and they work fine everywhere else.
so the problem is why they tell me about admin#localhost even the connection my code open by root.
are their anything my code try to do who need authentication or need admin account even they not have then give me exception.
Are you know that what is gone wrong.
I got this error after DB was moved to another server.
There no such user 'admin' so I got the error.
Solution:
log into mysql as root
grant all on *.* to admin#localhost identified by "s!5_superp#ss!";
flush privileges;

how to disconnection access in my C# program?

I tried to compress my Access 2007 database like this:
System.Diagnostics.Process.Start(#"C:\Program Files\Microsoft Office\Office12\msaccess.exe",#"c:\Mydb.mdb /compact ");
In my C# program and I get this error:
You attempted to open a database that is already opened exclusively by user on machine . Try again when the database is available. (Error 3356)
I tried Conn.close() but still get the error
Thanks in advance.
Maybe connection pooling is the issue?
Not completely sure where connection pooling is implemented (I believe that this is just part of the provider e.g. SQL server and therefore might not be relevant to this issue)
But it will keep connections open between the client and server even thougth the connection object is set to "closed".
You can clear a sql server connection pool using conn.ClearPool
What are you using for the provider to connect to your database? (OLEDB?)
If so try ReleaseObjectPool()
Check your Task Manager to see if you have Access already open. If you do, close these instances and retry.
Maybe something went wrong and you just have an extra *.ldb file out there. Go to where your DB is stored:
c:\Mydb.ldb
If no one is using it delete the file.
The way compact & repair works in Access is it compacts to a new file, deletes the original file and then renames. You can use the DAO Engine to do the same thing. As far as I can tell from MS Visual C# 2010 Express, you can set a reference to DAO and use that:
var MyDBE=new DAO.DBEngine();
MyDBE.CompactDatabase("c:\\docs\\Mybe.mdb", "c:\\docs\\temp.mdb");
To ensure the database is not in use, you can check if the .ldb exists.
I am sorry, but I do not know anything about c#, so these notes are very crude.
//Edit begin
Check out these basic troubleshooting items:
http://office.microsoft.com/en-us/access-help/troubleshoot-compacting-repairing-or-recovering-an-access-file-HP005188316.aspx?queryid=728e1007c19b43bba069cb7f11364f7a&respos=0&CTT=1
See if any of the above reasons are causing the compact to fail!
//Edit end
Check the following link:
http://support.microsoft.com/kb/209207
Use /excl with the code to open it exclusively.
So code would be:
System.Diagnostics.Process.Start(#"C:\Program Files\Microsoft Office\Office12\msaccess.exe",#"c:\Mydb.mdb /excl /compact ");
By using the excl option you will be opening it exclusively!
Hope it helps!

IIS Permissions for Saving Word Documents

Our ASP.NET/C# lets users edit and manage Word (OpenXML) documents that are hosted on a server. I am using client-side VBScript functions to handle some of the editing functions including saving the document to a folder on the server. For the save functionality, I am using the following function call :
Document.SaveAs "http://server/savefolder/savefile.docx"
I have given "Full Control" permissions on savefolder to both the NETWORK SERVICE and the IUSR_MACHINE users. Yet the above call fails. The error number returned is 5096. The error message is some gibberish that doesn't make any sense.
The server is Windows 2003 and the IIS version is 6.0. I have installed the OpenXML SDK 2.0 CTP on the server.
I can successfully read and print documents.
Does anyone tell me what I am doing wrong? or what additional settings need to be in place?
BTW, the error message ("gibberish" from my post) is:
"EOALPHABETICARABICARABICABJADARABICALPHABAHTTEXTCAPSCARDTEXTCHARFORMATCHI"
No, I am not making this up!
In my case, that error 5096 with description "EOALPHABETICARABICARABICABJADARABICALPHABAHTTEXTCAPSCARDTEXTCHARFORMATCHI"
occurred when using VBA code in Access to drive a Word mail-merge. The cause was trying to save a document with the same name (including path) as an open document.
Error line:
objApp.ActiveDocument.SaveAs saveAsName
where objApp is the object variable representing the Word application and saveAsName is the string variable storing the name I am trying to save the file as e.g. "C:\temp\testdoc.docx".
IF a file with the same name exists but is not open, the above code overwrites it silently.
Turns out WebDAV is not turned on by default in IIS 6.0. Once I turned it on, I was able to save the documents just fine.
Thanks for all your answers!
Just a guess... if the vbscript is running on the client, the code is probably running under the user's account, not under the server's IIS account. So unless you give write access to that user, vbscript probably won't work for this.
Since you're using ASP.NET, you could try writing a web service that takes in Word document data and saves it to the server for you.
I'd try running Fiddler on the client while trying to save the document to get a sense of what's really going on. I wonder if maybe it's trying to do an HTTP PUT (as opposed to a POST).
Have you given write access to the folder in IIS manager?
Is the save folder you're using outside of the websites root directory, i.e. 'hidden' from the internet?
Just to add to SI's information...
I also get this I get the 5096 - EOALPHABETICARABICARABICABJADARABICALPHABAHTTEXTCAPSCARDTEXTCHARFORMATCHI error when my code tries to save a MS Word document with the same name and to the same location as a Word document that is already open in another instance of Word.
Although not entirely relevant to this thread, I hope it may help someone else who stumbles upon this thread!
Regards,
Duane,
this question is old but still active ?
You save the file with a http://... url, i think you should save it with a file URL as
Document.SaveAs "\\server\savefolder\savefile.docx"
Grtz

Categories

Resources