Hi Guys,
Actually, there is a less painful way to sort this out...
I've hit the same issue here and it was driving me nuts, tried about everything (used all 4 repair options offered by apple) and I've been looking everywhere online for a solution but nothing really helpful in my opinion....
I managed to sort out this problem in a matter of a few minutes on my library of just over 20,000 pictures...
The reason for all this is simple, if at some stage iPhoto realizes that a picture is missing, it goes about writting in the database that the file for that picture is missing... Note to apple ppl, maybe iPhoto should actually check if the picture is there when one want to edit it instead of relying on old info stored in the DB...
Weirdly enough, reparing or rebuilding the database don't even fix this...
Anyway... The fix for this is simple... (I only have a mac here so i can't really comment on software or file location on a PC, but the principle would be exactly the same...)
Make sure all the pictures that are supposedly offline are where they should be and then set the ismissing flag in the database back to 0... If you are not sure where the file should be, you can easily find the imagePath in the database too...
While viewing/editing iPhoto database, make sure iPhoto is closed... (Now would be a good time to close it if it's still running 🙂)
iPhoto library is using SQLite 3, on a mac, you can use SQLite Database Browser (SQLite Database Browser | Free Development software downloads ...) It's completely free...
First things first, let's make sure we have a backup of the database first...
Go to your iPhoto Library, usually it would be in your user folder in the pictures subfolder. right click (ctrl + click) on iPhoto Library and select Show Package Contents. Open the database folder and make a backup of the apdb folder. Once done, open the apdb folder (the original folder, not the backup). The file we will be working on is Library.apdb.
Now, Open SQLite Database Browser.
Drag and drop Library.apdb on SQLite Database Browser main window to open the database.
Once the database is open, go to the Browse Data tab and select the RKMaster table.
If you scroll to the right you can see both the ismissing field and imagepath field.

The image path are relative path to the Masters folders in the iPhoto Library package...
From here, you have 2 options:
1) Go and edit by hand one by one the database entries where you have ismissing set to 1 and change it to 0
This can be useful if you want to "fix" only a few images... To do so, just double click on the cell you want to edit, a new window will open... replace the 1 with a 0 and click Apply Changes... Repeat for each pictures you want to fix...
This could obviously take hours if you have a huge database with a lot of missing/offline images... In this case, the option 2 is probably the way to go...
2) Click on the Execute SQL tab and enter the following code:
UPDATE rkmaster set ismissing = 0;
Then click the Execute query button. What this does is set for every entries in the database the ismissing flag to 0 basically telling iPhoto that the file is not missing...

After doing either option 1 or 2, make sure you save the database...
You can now close SQLite Database Browser and reopen iPhoto... Problem solved...
No need to spend hours copying your database to a new database and spend money on any software...
In a matter of a couple of minutes, everything is back to normal... Everything is just as before except that now iPhoto can see the original pictures again and you can have fun editing them again 😀
Have fun guys and if you have any questions, just drop me a line...