Have you tried:
-deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).
-switching to the default theme to rule out any theme-specific problems.
If you can’t access you dashboard properly then try this.
http://perishablepress.com/quickly-disable-or-enable-all-wordpress-plugins-via-the-database/
Try reinstalling WordPress 4.0.
Matthew
Many thanks for your reply, I have managed to solve the problem.