Today when I was attaching a database, I encountered a common error that pops up if there is no proper access rights set for the “mdf” file that you are trying to attach.
I remember few years back when I had encountered same error, I had wasted quite a lot of time than needed on getting this up and running…J
So here goes the step to generate the error and fix it.
I downloaded the adventure work database from http://msftdbprodsamples.codeplex.com/releases/view/93587
STEP 1: Right click on the databases in SSMS and click “Attach…”
STEP 2: Click on ADD and go to the path where you have your downloaded adventure work database and click ok.
In case you already have the permissions set properly the database will get created.
If the permissions are not set then you will get a pop up as shown in the screen shot below:
If you click on the hyper link present in the Message section then you will have this popup saying the detail of the error as shown below:
So by looking at the details in the popup it becomes evident that the error is due to some access rights on the file that you are trying to attach.
Go to the folder where your mdf file is present right click –> Properties and go to Security tab, click on authenticated user and Select the checkbox for “Fill Control” as shown in the screen shot below.
Again follow the Step 1 and 2, this time the database gets created without any error.
Hope this helps someone in need.
Posted: October 29, 2013 in SQL Server
Working with Macros in excel is always fun and for a C# developer, I bet it is always a challenge to work on VB code. One of the most handy thing to get going with excel form designing is the developer tab in the menu.
By default the developer tab will not be enabled, we should specifically enable it. This blog post shows you how to do it with screen shots.
Click on the File as shown in the screen shot below.
Click on Options as shown in the screen shot below.
Once you click on the Options a window will be opened in which we have to select customize Ribbon.
Select the check box for developer as highlighted in the screen shot below.
There you go with the developer tab in the excel where you can start designing your macros.
Well a simple tip for those who are starting on Macro’s in excel.
Hope you liked the post.
Posted: August 6, 2013 in Excel
A quick tip on transposing excels columns into row.
STEP 1 :
Copy the required range of cells in the excel as shown below
Once you get the copied cells, paste the copied cells where you want the copied cells to be transposed.
Paste the copied cells
Look into the bottom of the pasted cells which has a “Ctrl”. Click on that to get various option on converting the pasted cells. Click on Transpose to convert the columns into rows.
Posted: July 15, 2013 in Excel