Resolving "The SQL server cannot access database. Please Check access rights." in WinCC V7.0 SP3
The error "The SQL server cannot access database. Please Check access rights." is reported by WinCC Explorer at project open or new project creation time on a freshly installed WinCC V7.0 SP3 system. The dialog blocks opening of the WinCC project, even though the installer completed successfully and the project directory exists. The fault is not a corrupt installation by default: the dominant root causes on a new install are missing SQL Server instance permissions, the SQL Server (WINCC) service not running, the SIMATIC HMI user group membership, the project's .dcf configuration cache, or a domain/workgroup mismatch between the Windows logon and how WinCC registers the SQL Server instance. This reference walks through each layer with verification steps.
1. Problem Statement and Observed Symptoms
Reported environment: WinCC V7.0 SP3, SIMATIC Net V8.1 SP1, Windows 7 Professional 64-bit SP1. The user attempted to launch WinCC Explorer as an administrator and was blocked by the SQL access error on the very first start. A complete reinstall of WinCC did not clear the condition.
Symptom matrix:
| Symptom | Likely Layer | First Diagnostic |
|---|---|---|
| WinCC Explorer dialog shows SQL access error before any project loads | SQL Server instance or service | Check SQL Server (WINCC) service state |
| Error appears only on a specific project, new projects open fine | Project database / .dcf
|
Delete .dcf, reopen |
| Error appears on every project after reinstall | Windows user rights or domain configuration | Run SIMATIC Rights tool, validate group membership |
SQL Server Management Studio cannot connect to \.\WINCC
|
SQL Server instance not started or named-pipes disabled | Start service, enable protocols |
| Error appears on a PCS 7 multi-project | Configuration database of the master project | Adjust master project database settings |
2. Root Cause Analysis
WinCC V7 stores every project (including the alarm logging, tag logging, and user administrator databases) inside Microsoft SQL Server. WinCC uses its own named SQL Server instance called WINCC, which is installed side-by-side with whatever default SQL Server may exist on the workstation. When WinCC Explorer attempts to attach the project database, it connects to WINCC using the credentials of the logged-on Windows user, mapped against the SQL logins created during install.
The error "The SQL server cannot access database. Please Check access rights." fires when one of the following layers denies that connection:
- The
SQL Server (WINCC)Windows service is not started, has been disabled, or its startup account was changed. - The logged-on Windows user is not a member of the
SIMATIC HMIlocal group, which WinCC installer provisions specifically for SQL access. - The project folder's NTFS permissions do not grant
SIMATIC HMIfull control, blocking the SQL data and log file (.mdf, .ldf) from being opened. - The machine is joined to a Windows domain and the SQL Server instance was registered under the local system account rather than a domain account, so the domain user has no SQL login.
- The
.dcf(Data Configuration File) of the project is corrupt or out of sync with the SQL database; WinCC treats the project as inaccessible.
Siemens documents the related ES-OS download behavior in the official WinCC FAQ at Siemens Support Entry 59216666, which enumerates the same user-rights, folder-share, and SQL-connection prerequisites that apply to a new local install.
3. Prerequisites Before Troubleshooting
Verify the following before touching services or permissions:
- WinCC V7.0 SP3 installed with administrator credentials (WinCC setup must be run elevated).
- SIMATIC Net V8.1 SP1 installed and licensed if industrial Ethernet or named connections are used by the project.
- Logged-on user is a member of the local
Administratorsgroup on the engineering station. - SQL Server 2005/2008 instance
WINCCwas installed by WinCC setup and is visible underSQL Server Configuration Manager. - Microsoft SQL Server Management Studio (SSMS) matching the WinCC SQL generation is available — WinCC V7.0 SP3 installs SQL Server 2008 R2 Express SP1 by default. If SSMS is missing, the WinCC setup disk under
\InstData\SQL2008\...\Tools\Setupcan add it.
WINCC service account to anything other than Local System or the account originally chosen by the WinCC setup. SQL Server 2008 R2 Express used by WinCC V7 is configured by the installer to use a specific logon; altering it after install breaks the named-instance channel that WinCC uses.4. Step-by-Step Resolution
4.1 Confirm the SQL Server (WINCC) Service Is Running
- Press
Win + R, typeservices.msc, press Enter. - Locate SQL Server (WINCC). Verify:
- Status: Running.
- Startup Type: Automatic (not Disabled, not Manual).
-
Log On As:
Local SystemorNT AUTHORITY\SYSTEM.
- If the service is stopped, right-click → Start. If startup fails, note the Windows Event Viewer error ID (commonly 7000, 7034, 1069) and continue to 4.2.
4.2 Validate SQL Connectivity With Management Studio
- Launch SQL Server Management Studio from the Start menu.
- In Server name, type
WINCCor.\WINCC(period-backslash-WINCC is the local named instance shortcut). - Authentication: Windows Authentication.
- Click Connect. If the connection succeeds, SQL itself is healthy and the WinCC-side issue is project- or rights-related. If it fails with error
233,-1, or26, jump to the network protocols section below.
4.3 Enable SQL Server Protocols
WinCC requires named pipes and TCP/IP on the WINCC instance.
- Open SQL Server Configuration Manager (Start → Programs → Microsoft SQL Server 2008 → Configuration Tools).
- Expand SQL Server Network Configuration, select Protocols for WINCC.
- Right-click Named Pipes → Enable. Right-click TCP/IP → Enable.
- Right-click SQL Server (WINCC) service in
SQL Server Services→ Restart. - Retry the Management Studio connection.
sc command or registry edits to HKLM\SOFTWARE\Microsoft\Microsoft SQL Server\... for protocol flags are unsupported by Siemens for WinCC.4.4 Run the SIMATIC Rights Tool
The SIMATIC Rights utility (often labelled SimaticRights.exe on the WinCC DVD or already installed under C:\Program Files\Siemens\Automation\WinCC\bin\) applies the canonical rights profile to the local machine.
- Insert the WinCC V7.0 SP3 DVD or mount the ISO. Locate the
SimaticRightsdirectory under\InstData\...or run it from the localbinfolder. - Start
SimaticRights.exeas administrator. - Select the project path or simply let the tool scan
C:\Program Files\Siemens\Automation\WinCC\Projects. - Click Apply Rights. The tool grants:
- Full control to
SIMATIC HMIon the project directory. - Full control to
Administrators. - SQL Server login provisioning on the
WINCCinstance for members ofSIMATIC HMI.
- Full control to
- Restart
SQL Server (WINCC)and the WinCC Explorer.
4.5 Add the User to SIMATIC HMI Manually
If the SIMATIC Rights tool is not present, apply the same grants by hand:
- Right-click Computer → Manage → Local Users and Groups → Groups.
- Open
SIMATIC HMI. If the group does not exist, the WinCC setup was incomplete — re-run setup with the Configure option and enable SIMATIC HMI user group creation. - Click Add, type the current Windows logon name (e.g.,
DOMAIN\ftems), confirm. - On the project folder (
C:\Program Files\Siemens\Automation\WinCC\Projects\<ProjectName>): right-click → Properties → Security → Edit → Add. AddSIMATIC HMIwith Full Control. Tick Replace all child object permissions. - If the project is on a network share, share the folder and grant
SIMATIC HMIChange + Read. Set NTFS as above.
4.6 Confirm Domain vs Workgroup Configuration
WinCC V7 supports both workgroup and domain workstations, but the SQL Server WINCC instance must be told which. Open Computer Properties and check Domain or Workgroup:
-
Workgroup: confirm the local account used to log on is a member of
SIMATIC HMI. SQL logins will be resolved asMACHINE\Username. -
Domain: the
SQL Server (WINCC)service must run with an account that can enumerate domain principals, or — the more common approach on WinCC V7 — the logged-on domain user must be added explicitly to SQL Server Security underWINCC\Security\Loginswith thesysadminserver role on the WinCC instance.
4.7 Clear the .dcf File
For situations where the error appears on one specific project (typically a PCS 7 project opened in WinCC Explorer):
- Close WinCC Explorer.
- Open the project directory.
- Locate the file
<ProjectName>.dcf. - Rename to
<ProjectName>.dcf.bakor delete it. - Reopen the project in WinCC Explorer. The configuration tool regenerates the
.dcfagainst the SQL database.
.mdf or .ldf files inside the project folder. Those are the SQL data and transaction log files; deleting them destroys the runtime database.4.8 PCS 7 Multi-Project Adjustments
If the failing project is a PCS 7 master or subordinate opened in the WinCC Explorer, the configuration database referenced by the master project stores the path to each subordinate. When that path or the subordinate's database name does not match the actual SQL Server content, WinCC reports the SQL access error at open. Repair:
- Open WinCC Explorer on the master project; close without opening the subordinate.
- Use SIMATIC Manager → Options → PCS 7 → Master Data Library tools, or edit the master project XML configuration to align subordinate paths.
- Open the subordinate project independently in WinCC Explorer to validate its own SQL connectivity.
- Re-link from the master.
5. Verification Procedure
After applying the corrective steps, validate end-to-end:
- Log off and back on with the affected user so the new group memberships propagate.
- Open SQL Server Management Studio and connect to
.\WINCCwith Windows Authentication. - Expand Databases; the WinCC runtime databases
CC_<ProjectName>_ALG_<R>,CC_<ProjectName>_TLG_<R>, and user administrator database should appear with the logged-on user listed under Security → Logins. - Launch WinCC Explorer. The SQL access dialog must not appear. The project tree should populate within 5–15 seconds.
- Activate the project. Runtime must reach the Activated state without re-prompting for SQL credentials.
- Open User Administrator inside the project; existing operator logons should load without SQL errors.
Expected verification timings on Windows 7 SP1, 64-bit, with SQL Server 2008 R2 Express:
| Step | Healthy Threshold | Failure Indicator |
|---|---|---|
| SQL Management Studio connect | < 2 s | Error 233, -1, or 26 |
| WinCC Explorer project open | 5–15 s | SQL access dialog reappears |
| WinCC project activation | < 30 s for small projects | Stalls at "Connecting to SQL Server" |
| User Administrator open | < 3 s | Empty list or access denied |
6. Field-Proven Diagnostic Matrix
| Check | Command / Tool | Healthy Result | Failure Action |
|---|---|---|---|
Service SQL Server (WINCC)
|
sc query "SQL Server (WINCC)" |
STATE: 4 RUNNING |
sc start "SQL Server (WINCC)", fix logon |
| Named instance listening |
netstat -ano | findstr 1433 and dynamic ports for WINCC
|
TCP <port> LISTENING | Enable TCP/IP and Named Pipes |
| Group membership | whoami /groups | findstr /i "SIMATIC HMI" |
Group listed as enabled | Add user to SIMATIC HMI
|
| Project NTFS rights | icacls "C:\Program Files\Siemens\Automation\WinCC\Projects\<Project>" |
SIMATIC HMI:(OI)(CI)(F) present |
icacls <dir> /grant "SIMATIC HMI:(OI)(CI)F" /T |
| SQL login exists | SSMS → WINCC\Security\Logins
|
DOMAIN\username or MACHINE\username listed | Create login, grant sysadmin
|
.dcf integrity |
File timestamp vs last save | Matches last project save | Delete .dcf, reopen project |
| Domain context | systeminfo | findstr /i "Domain" |
Domain matches expected | Re-run SIMATIC Rights, refresh SQL logins |
| Event log SQL errors |
eventvwr.msc → Windows Logs → Application, source MSSQL$WINCC
|
No errors | Capture error ID and message text |
7. Common Pitfalls on New Installations
-
UAC silently stripping the SQL connection. On Windows 7 SP1, if WinCC Explorer is launched without Run as administrator from a non-elevated session, the SQL connection fails even though the user is in
SIMATIC HMI. Always launch WinCC Explorer elevated on a new install until UAC behavior is verified. -
Antivirus blocking named pipes on
WINCC. Endpoint security suites can quarantinesqlservr.exeor block \.\pipe\sql\query. Whitelist the SQL Server binary and the WinCC installation tree. - SQL Server 2008 R2 Express instance already installed for another application. If a prior SQL Server installation already binds port 1433 or named pipes, the WinCC setup creates a different named instance but the conflicting instance can still interfere with SQL Browser service resolution.
-
Folder redirection of
Documentsinto a network share. When the user's profile path is redirected, the WinCC project path under the user profile becomes inaccessible to the SQL service account. Use onlyC:\Program Files\Siemens\Automation\WinCC\Projects\on the local disk. -
Reinstall without uninstall. Running setup again without first using Control Panel → Programs and Features → Uninstall leaves the old
WINCCSQL instance attached but unregistered, producing fresh access errors.
8. Safe Repair Procedure for a Bricked SQL Instance
If none of the above resolves the error and SSMS cannot connect to .\WINCC:
- Stop
SQL Server (WINCC)fromservices.msc. - From Programs and Features, uninstall Microsoft SQL Server 2008 R2 (WINCC). This removes only the named instance; the system databases are rebuilt on next WinCC setup.
- Insert the WinCC V7.0 SP3 DVD. Run Setup → Configure → tick Microsoft SQL Server 2008 R2 + SIMATIC HMI user group.
- After setup completes, reboot. The
WINCCnamed instance returns with default credentials and theSIMATIC HMIgroup is created. - Re-run SimaticRights.exe on each existing project.
- Open WinCC Explorer and test against a brand-new test project before opening the original.
GraCS, Pictures, Library, and the .ldf/.mdf pairs for runtime databases. Although the SQL instance can be rebuilt, loss of these files is unrecoverable without a backup.9. Interaction With SIMATIC Net V8.1 SP1
SIMATIC Net V8.1 SP1 adds its own SQL footprint and S7DOS services. On a new installation where SIMATIC Net is installed after WinCC, the SIMATIC Net setup can reassign permissions on SIMATIC HMI to favor its own components and strip the SQL Server logins for WinCC users. If the error appears immediately after SIMATIC Net installation:
- Open SQL Server Configuration Manager and verify the
WINCCinstance is still listed under SQL Server Services. - Run SimaticRights.exe from the WinCC DVD; this reasserts WinCC SQL logins.
- Restart
SQL Server (WINCC)andS7DOSin that order.
The official Siemens WinCC V7 installation manual recommends installing SIMATIC Net before WinCC to avoid this conflict.
10. Related Siemens Documentation
- Siemens Support Entry 59216666 — ES-OS Download FAQ
- Siemens Support Entry 109751596 — WinCC V7 Installation Notes
- Siemens Support Entry 109751603 — WinCC V7 Commissioning Manual
- Microsoft Learn — SQL Server 2008 R2 Components Reference
11. FAQ
Why does WinCC show "The SQL server cannot access database" on a brand-new install with no projects created yet?
The WinCC Explorer still tries to attach to the SQL Server WINCC named instance to enumerate user, alarm, and tag databases. If the SQL Server (WINCC) service is not running or the logged-on user is not a member of the SIMATIC HMI local group, the connection is refused. Verify the service state in services.msc and add the user to SIMATIC HMI.
Does reinstalling WinCC V7.0 SP3 clear the SQL access error?
Usually no. The reinstall keeps the prior WINCC named SQL Server instance with its existing logins. A clean repair requires uninstalling the Microsoft SQL Server 2008 R2 (WINCC) instance from Programs and Features first, then rerunning WinCC setup with the Configure option to rebuild the instance.
What is the purpose of the SIMATIC HMI local group?
The group is created by the WinCC installer and used as the security principal that grants NTFS rights on the project folder and the corresponding SQL Server login on the WINCC instance. Members inherit full access to project databases without individual SQL Server login management.
Can I delete the project .dcf file to recover from this error?
Yes, but only when WinCC Explorer is closed. The .dcf file is a configuration cache; deleting it forces WinCC to regenerate it from the SQL project database on next open. Never delete the .mdf or .ldf files — those are the SQL Server data and transaction log files for the runtime database.
Does WinCC V7.0 SP3 support Windows 7 SP1 in a domain?
Yes, but the domain user must be added as a SQL Server login on the WINCC instance with the sysadmin role, or be a member of the local SIMATIC HMI group. If the SQL Server service runs as Local System, the domain principal resolution for SQL logins still works, but only if the login was explicitly created. Refer to the official ES-OS download FAQ at Siemens Support Entry 59216666 for domain-specific configuration steps.