For those attempting to recover lost or accidentally deleted photos or videos, see this linked article instead. For those who've simply forgotten their card's password, scroll down to the bottom of this current article. For those that have taken many previous photos with the card, but suddenly your camera or computer wishes to "format" the card, see the "corrupted card procedures" located near the bottom of this linked article instead. For those with Compact Flash (CF) cards, please see this article instead. Finally, for those that are still here with SD card problems, please continue reading.
Please check to make sure that you didn't accidentally place the tiny locking slide switch on the side of your SD card in the "locked" downward position. The correct "unlocked" position should be slid up toward the direction of the connectors. If you discover that the locking switch is actually missing or has broken off, proceed directly below to Fix #4a.
Card Switch in Downward "Locked" Position
FIX 2: Old cameras and the card readers on older computers just can't read 4GB or higher SDHC cards. If this problem is just happening after purchasing a brand new card, AND your camera is an older camera (about 2008 or older), I'm going to guess that you just bought a new 4GB or larger SDHC card. If the above is true, continue reading. If not true, skip to Fix 3.
FIX 3: If you've had the card for a while, but it just recently started to show "memory card error" or "card requires formatting", ask yourself if you can ever remember formatting your card IN THE CAMERA. If you can't remember doing such (or don't know what a format is) continue reading. But if the description above doesn't apply to you, skip to Fix 4.
FIX 3B: Again, if file corruptions occur intermittently, AND you use a card reader, do you remove the card properly from the reader? When ejecting a memory card from its reader, recommend that you always select the "Safely Remove Hardware and Eject Media". This selection is located in the bar in the lower right-hand corner of your computer screen (if using a PC).
Fix 4A: The famous "tape" fix (sorry, I can't claim this one). If none of the above seems to work, or if you've found that you've broken the locking tab on the card, one final thing to try before opening the camera is good old tape. Cut a tiny piece of clear cellophane tape (use scissors to trim it), and place it tightly over the slot where the locking switch is, or was. I can't stress it enough, keep the piece of tape small, you don't want to jam your card in the camera. Now slide the card into the camera. If you encounter any resistance, STOP, the tape is likely too thick or too much. But if not, proceed and see if that corrects the problem.
FIX 5: If you've come this far and you're still getting a "card locked" error, it may be time to consider opening the camera to force open this switch, or to inspect its wiring (not recommended unless you have some familiarity with electronics). In this case please see this blog article instead (xscrewdriver, hope you don't mind me referencing your blog).
LOST PASSWORDS FIXES
Forgotten passwords can be recovered using the following procedures (from kioskea.net).
Lost Password Fix One:
1. Open the file manager of your mobile
2. In Settings choose system folders,
3. In the System folder, find a file called mmcstore
4. Send the file to your PC using IR/Bluetooth
5. Open the file in Notepad
6. The password you need for your memory card is located within that file
Lost Password Fix Two:
1. Insert your card into your phone, without accessing it through the phone
2. Run FExplorer and Open the path C:\system
3. Find the file called mmcstore, and rename it mmcstore.txt
4. Copy that file (mmcstore.txt) to your PC and open it in Notepad
5. Your password will be located within that file.
For Nokia Users with MicroSD :
Put the card in any E series mobile or N95 etc and format it. It will not ask for a password.