A study of mechanisms linking type 2 diabetes mellitus and dementia