|
-
Nov 19th, 2007, 08:19 AM
#1
Thread Starter
Hyperactive Member
Problem Attaching SQL Server Database file
plz, there is something strange i noticed while attaching sql server database. Am attaching from my VB code. when i place the database file on my c: drive(or any directory within this drive),it gets attached to my sql server instance(am using sql server 2005 express edition and run windows XP). But when i placed the database file in My Document, it doesn't get attached.I tried using my sql server management studio. i can locate the database file when i tried attaching it from c: drive but the node for My Documents folder cannot be expanded (actual path is "C:\Documents and Settings\Oyad\My Documents"). Cannot file reside in My Documents folder?
Nobody is smarter than all of us!
-
Nov 19th, 2007, 08:23 AM
#2
Re: Problem Attaching SQL Server Database file
Well, a database is not a document so even if it could be in MyDocuments, it shouldn't be.
May I ask why you want to put it there?
-
Nov 19th, 2007, 08:45 AM
#3
Re: Problem Attaching SQL Server Database file
Are you using the actual path - the C:\Documents and Settings\Oyad\My Documents path?
Or are you trying to use the virtual folder "My Documents"?
-
Nov 19th, 2007, 10:47 AM
#4
Thread Starter
Hyperactive Member
Re: Problem Attaching SQL Server Database file
 Originally Posted by szlamany
Are you using the actual path - the C:\Documents and Settings\Oyad\My Documents path?
Or are you trying to use the virtual folder "My Documents"?
Its actually i web application i did 4 a friend & he extracted into his document folder (My Document) ,along with d application ,i created a small windows application 4 him 2 attached d database but d database was not attaching, i then came down personally 2 fix d problem, installed SSMS & tried attaching, right -click on databases node in object explorer windows, selecting Attach..,d Attach database window comes up, i clicked on Add button,using Locate Datafile tool, Oyad node under Documents and Settings cant b expanded too.
The small windows program i wrote is using d full path (using Open dialog) to attach d file. Its attaches d file when its in a location like "C:\New Folder" or whatever but cannot attach for paths starting with "C:\Documents and Settings\"..., i dont know if its a folder permission/restriction setting stuffs
Nobody is smarter than all of us!
-
Nov 19th, 2007, 11:01 AM
#5
Thread Starter
Hyperactive Member
Re: Problem Attaching SQL Server Database file
 Originally Posted by Hack
Well, a database is not a document so even if it could be in MyDocuments, it shouldn't be.
May I ask why you want to put it there?
it is contained in an application 4 a friend, he could place it any where
Nobody is smarter than all of us!
-
Nov 19th, 2007, 11:04 AM
#6
Re: Problem Attaching SQL Server Database file
http://blogs.msdn.com/sqlexpress/arc...nt-studio.aspx
Additionally, the default service account used by SQL Express do not have permissions for any of directories in a user profile, such a My Documents, which is the default location for databases created by VS. In your case, either you have given the Network Service account permissions for your user profile directories, or you are running SQL Express under a different account that does have permissions for those directories. (Or |DataDirectory| is pointed to somewhere that is not in a user profile.)
Seems you have a known issue with My Documents...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|