Prosecutors can obtain all sorts of information without your consent by subpoena directly to the record holder, though it usually isn't done without your knowledge. But considering the difference between knowledge and consent, knowing what they are getting a hold of doesn't really help if they get it anyway, even if you know about it.
Sometimes information can be obtained without your knowledge, but eventually they will have to present it in the case against you. One way of the other you will find out what they have, whether it is at your trial or before.
Attorney answers to questions are for general purposes only and do not establish an attorney-client relationship. This answer is meant for informational purposes only and should not be construed as legal advice within the bounds of a professional relationship. It is always best to seek counsel with a competent attorney experienced in your area of issue and fully informed about the facts of your case.