I cannot refresh an excel file that is connected to MS access database - ms-access-2010

I built a query in MS access 2013.
I closed the MS access app.
I linked the query in Excel.
But now, when my excel file is opened, I can see that there is a ".laccdb" opened also. It's acting like my whole MS access DB was opened. So i can't refresh my query because its giving me "You attempted to open a database that is already opened by user 'Admin' on machine 'My Computer.' Try again when the database is available."
How can I fix that?

Related

Unable to create user for a restored database in SQL Server 2012

I started a few developments in a developed ASP.NET web site. I restored the Db successfully to the SQL Server 2012, and once I created a new login for a user wilsondbuser. And I worked with it very well.
After 2 days, when I visit to the SQL Server again, there was no that created user in the Security tab of relevant Db. But the user was in the SQl Server Security tab. And also no any table displayed.
So, I deleted that user, only exist in the Security tab of relevant Db. Then I tried to create the same user in SQL Server. Then it displayed following error.
Please help me to again work with that restored database.
Try below steps solved the problem:
Copy database files to another location
Delete main files
Restart SQL Service.
In management studio the database will be shown with "Recovery Pending" in front of its name, delete it.
Attach your database with copied files of the first step.
Create the user you want.

ASP.NET Opening Excel Sheet Error: MS Access DB Engine cannot open or write to the file..."

I'm getting an error message when trying to open an excel sheet from my ASP.NET website:
The Microsoft Access database engine cannot open or write to the file ''. It is already opened exclusively by another user, or you need permission to view and write its data.
I'm wondering if this has to do with me playing around with the "Owner" of my documents folder today.
How can I resolve this?
TIA
I needed to grant the NETWORK SERVICE account modify permission on my folder.

How to access files remotely in asp.net website?

I am making a website in asp.net using c# and sql server 2008.
I made one web form in which there are two buttons, on first button click ,i select a excel file from my computer drive. and on second button click ,,the whole file data is copied to sql server table.
this works fine. but i want to know how can i load and saved that file in databse table, if i want to access that website from another system. how to access that system files remotely.
Save that Excel file on the server
FileUpload1.SaveAs(Server.MapPath("~/AppFolderName/" + FileName));
and then later on you will able to access the same file from any where from application server
You have to upload that file on server first in order to access it. you can do it by Fileeupload control and HttpPostedFile

deploying from sql server express to datacenter

I'm taking the database that I created with SQL server express and putting it on a server in a datacenter. There are 2 database files in AppData folder: the aspnetdb.mdf file and the file I created for my site MySite.mdf. I'm using the ASP login control and that works with the ASPNETDB.mdf file and it's working. If I log in without the correct username/pwd, it'll display a bad login message.
However, as soon as I login and the site goes to make a request to MySite.mdf, I get an error "Invalid object name 'dbo.Users'." which is the name of the first table the site looks into after the login.
I've attached the MySite.mdf file to the server and copied the connection string the hosting company is generating into the web.config file and left the rest as is.
Could it be that I can't attach a sql express file?
Please let me know if you've run into this issue or if you have any suggestions.
Thanks.
Based on your description and the following assumptions:
your authentication still works
you haven't mentioned attaching your aspnet.mdf
you have separate databases for security and datastore
you're probably still testing locally
I'd guess that your application is still pointing at your local aspnet database - that's why authentication still works. Typically in a shared host, you'll have to install/insert the asp.net security database items to your main database. See This MSDN page for instructions on setting up the asp.net database objects.
You need to establish whether or not you've actually attached your database or not. Is there an online "database manager" you can access? Or can you connect to your database from SSMS or your dev environment and run a simple query?

Cannot open database requested by the login. The login failed. Login failed for user

I have copied a DB from one my computers and using it here. On trying to open the page which requires the fetching content from DB, on con.open I am getting this exception:
Unable to open the physical file "E:\Program Files\Microsoft SQL
Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\cakephp.mdf". Operating system error 32: "32(The
process cannot access the file because
it is being used by another
process.)".
Unable to open the physical file "E:\Program Files\Microsoft SQL
Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\cakephp_log.LDF".
Operating system error 32: "32(The
process cannot access the file because
it is being used by another
process.)".
Cannot open database "cakephp" requested by the login. The login
failed.
Login failed for user 'Sarin-PC\Sarin'.
I have attached the database from Management Studio Express 2008 and I have also checcked the connection string. Here it is:
<connectionStrings>
<add name="cn" connectionString="server=.\sqlexpress;database=cakephp;integrated security=true;uid=sarin;pwd=******"/>
</connectionStrings>
In Visual Studio, when I test the connection, it says "Test connection succeeded". However, there is one strange thing going on. When I login to the Management Studio, there is no + sign with the newly attached database, as shown.
If the full WebConfig is reqiured to be seen, I have pasted it here: http://pastebin.com/sVAuN0Ug
There are users of the database, but, there are also users of the server. One user has to have login rights to SqlServer before it can use the database.
In your case you copied the database and it's users, but those users don't have login permissions on the new server. Solution would be to add a new Login account on SqlServer (go to the Security node of the SqlServer, not the Security node of the database), and add it there. When you add that user, assign it to the database as well, and that should work.
Edit: After reading your issue further, is it possible that there are two sql servers targeting the same mdf file? Because that cannot work. Also, when copying database files, have you detached them before copying? If that's all fine, then try making backup and then restore.

Resources