There are two main types of dementia - Alzheimers, which is related to abnormal clumping of protein fragments around the neurons - I don't know if there is a direct diabetes connection, though there might well be.
The other is vascular dementia which is related to circulatory insufficiency - since sustained high blood glucose causes a host of circulatory problems in a number of organs (google for atherosclerosis and diabetes or dementia), it is not surprising that it has an impact on the brain too.
Some Oxford research published in PLOSS1 (Public Library of Science) finds that supplementation with B6, B12 and Folate can dramatically reduce vascular dementia (again, you can google that and make your own mind up about supplementation)
Since early dementia runs in my family, I started taking the supplements when I first became aware of the research through friends (long before publication). I'm now over 60 and show no real signs of mental degradation, yet am already some years older than my father was when his symptoms were already quite pronounced.
As with so many things diabetes, the best course seems to be to keep your BG as close to non-diabetic levels as you reasonably can.
MarkD