By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,639 Members | 1,326 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,639 IT Pros & Developers. It's quick & easy.

Database throwing 'attempt to attach an auto-named database for file....' error

P: 116

I am packaging a single downloadable file via Inno Setup from a VB setup file and all is fine. However when it reads the following db connection line ....
Expand|Select|Wrap|Line Numbers
  1. Dim connStr = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\abcd.mdf;Integrated Security=True;User Instance=True"
it throws the following error...

"an attempt to attach an auto-named database for file...."

I have a feeling that I need to check if the database abcd.mdf is already on the user's computer but it doesn't throw the error when debugging etc. I thought this connection line just connected to the db but it seems to suggest that it is attaching something each go.

Bit confused as to how to solve this one.

Oct 19 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.