Hi,
Iam using Sql 2000 as Back End
Iam attaching Database at runtime.
I have used foll code to attach database:
vConn.ConnectionString = "Data source=Localhost;uid=" + UID + ";pwd=" + UPWD + ";database=Demo;AttachDbFileName=|DataDirectory|Demo.MDF;";
But while running code it giving me foll error:
Device activation error. The physical file name 'C:\Documents and Settings\admin\Desktop\Demo\Demo\bin\Debug\Demo.MDF' may be incorrect.
Could not attach database 'Demo' to file 'C:\Documents and Settings\admin\Desktop\Demo\Demo\bin\Debug\Demo.MDF'.
Plz help me out!
Loading

Sam HobbsPosted Dec 25, 2010, 1:43 AM
The connection string is using "|DataDirectory|", which is very normal. The problem is that the rules for determining what that means (what that directory is) is quite complicated. I think it is very normal for it to be the debug directory for the project, so if the path and filename for the mdf file are correct, the problem must be something not shown here. I just don't know where to look, but I think it is best to first ensure that the path and filename are correct.
Suthish NairPosted Dec 25, 2010, 1:19 AM
Move it to the Project folder.
Pravin GhadgePosted Dec 24, 2010, 6:41 AM
My querry is not resolved
Pravin GhadgePosted Dec 24, 2010, 6:39 AM
I have check path but it is correct
Suthish NairPosted Dec 24, 2010, 3:12 AM
Your query resolved?
Sam HobbsPosted Dec 22, 2010, 6:57 AM
Note that there are two folders with the name "Demo". That is possible and it can work and there is nothing wrong with that if you want that, but it seems suspicious to me. It might not be the correct path for your project.
Suthish NairPosted Dec 22, 2010, 6:13 AM
Madhu KPosted Dec 21, 2010, 8:18 AM
Pravin GhadgePosted Dec 21, 2010, 7:59 AM
But i dont know hw 2 check permissions for accessing the file.
Madhu KPosted Dec 21, 2010, 7:08 AM