New Installation Won't Startup In order to Connect to Existing Database

4/21/2020 12:11 PM

[General Info]

Application: SambaPOS
Version: 5.3.0
Region: en
DB: SQ
Machine: DESKTOP-52UPMM7
User: Surface
Date: 4/21/2020
Time: 4:11 AM

User Explanation:

Surface said “”

[Exception Info 1]

Top-level Exception
Type: System.Data.SqlClient.SqlException
Message: CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file ‘C:\Users\SurfaceSambaPOS5.mdf’.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Source: .Net SqlClient Data Provider

Stack Trace is pretty boring. I think it’s smart enough to not try to create a database file in the C:\Users system folder, and is most likely maybe missing a \ after the “Surface” username?

Username Surface was not chosen by me, but i’m stuck with it for now.

How do I get the instance installed so I can connect it to existing database. Urgently need answer!

Try this
https://blog.sqlauthority.com/2018/08/25/sql-server-fix-create-file-encountered-operating-system-error-5-access-is-denied/

Your solution is enabling write-rights to C:\Users folder?

Or use a different folder, new folder in root of drive. Users directory has allot of permissions locked down.
Seems like add location for an mdf file to be.

1 Like

If your user is ‘Surface’, your path to the mdf should be C:\Users\Surface\SambaPOS5.mdf. You’re missing a backslash after surface.

It’s highly recommend to use MS SQL Server Express - up to 2014 for Windows 7 and 2016+ for Windows 8-10. https://kb.sambapos.com/en/2-1-3-a-sql-express-server-setup/