• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 335
  • Last Modified:

Directory lookup for the .... I need to clean this up.

An error occured when creating database: [DataConnection.ExecuteQuery]: Query: CREATE DATABASE [KenticoCMS] COLLATE SQL_Latin1_General_CP1_CI_AS: caused exception: Directory lookup for the file "C:\Users\omegalove\Desktop\innovative_rolebased_WAT_demo\sample\App_Data\UsersDb.mdf\KenticoCMS.mdf" failed with the operating system error 3(The system cannot find the path specified.).
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Creating a new database KenticoCMS
0
mathieu_cupryk
Asked:
mathieu_cupryk
  • 5
  • 4
  • 2
1 Solution
 
rob_farleyCommented:
You may want to specify the files to use, and make sure you use a path you can write to.

http://msdn.microsoft.com/en-us/library/ms176061.aspx

Rob
0
 
mathieu_cuprykAuthor Commented:
something is wrong this file is screwing installations.
I removed it and still problems
0
 
rob_farleyCommented:
Use:


CREATE DATABASE [KenticoCMS]
ON
( NAME = KenticoCMS_dat, FILENAME = 'C:\KenticoCMS.mdf')
LOG ON
( NAME = KenticoCMS_log, FILENAME = 'C:\KenticoCMS.ldf')
COLLATE SQL_Latin1_General_CP1_CI_AS
;

...making sure that the SQL Server Service Account group can access to write to C:.

But better is... use the real Data directory.

Rob
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
rob_farleyCommented:
Like:

CREATE DATABASE [KenticoCMS]
ON
( NAME = KenticoCMS_dat, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\Data\KenticoCMS.mdf')
LOG ON
( NAME = KenticoCMS_log, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL.1\Data\KenticoCMS.ldf')
COLLATE SQL_Latin1_General_CP1_CI_AS
;
0
 
mathieu_cuprykAuthor Commented:
i know that this will work but it is not a solution.
0
 
RiteshShahCommented:
can you show me which T-SQL script you have used for creating database? I am sure there is a rights issue with your service account. Moreover, try to check default data location from server property, what is a default path when you create database. than check do you have permission to access that path?
0
 
rob_farleyCommented:
Mathieu,

Why isn't it a solution? What bit isn't a solution?


Do you really have a folder called "C:\Users\omegalove\Desktop\innovative_rolebased_WAT_demo\sample\App_Data\UsersDb.mdf\" that you're trying to create files in?

And does the service account have permission to write to that folder (remember that the service account is hopefully a very low-privilege user)?

Rob
0
 
RiteshShahCommented:
if your service account won't have diskadmin rights, it will not be able to write the file.
0
 
mathieu_cuprykAuthor Commented:
I had this file and I deleted it =.
C:\Users\omegalove\Desktop\innovative_rolebased_WAT_demo\sample\App_Data\UsersDb.mdf
when I try to create a dabase. see attached file.

error.gif
0
 
rob_farleyCommented:
Ok. If you scroll that Database Files section to the right, you should be able to put your own filenames in... making sure they're in a real directory.

Rob
0
 
mathieu_cuprykAuthor Commented:
awesome
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 5
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now