Troubleshooting
WinCC can't access database after power loss: DCF and reset steps
Short answer
After a power loss, a WinCC station that reports "Microsoft SQL Server can't access the database" is usually fine at the database level. Run reset_wincc.vbs and reboot first; if the error remains, stop the SQL Server (WINCC) service, delete the project's .dcf file, restart the service, and let WinCC recreate it before changing any access rights.
On this page
When a WinCC station starts reporting "Microsoft SQL Server can't access the database, please check the access rights" in WinCC Explorer right after a power interruption, the database itself is usually intact. Run reset_wincc.vbs and reboot first. If the error survives that, stop the SQL Server (WINCC) service, delete the project's .dcf file, restart the service, and let WinCC recreate the file. Only when both steps fail should you work through identity, group membership and network checks — and treat master-database corruption as a hypothesis until the Application event log confirms it.
Identify the failure scope #
The reported pattern after a power loss is an Autostart failure — "Error while opening the project, Autostart not possible" — followed by the SQL Server access error when WinCC Explorer is started from the desktop shortcut. Before changing anything, narrow the fault:
- Confirm the OS project path and project name configured on the station are exactly right. On a multiproject, check the target path character by character.
- Open the Windows Application event log and look for a matching SQL Server or WinCC error at the time of the failure.
- Confirm nothing changed on the station at the same time: a renamed computer, a domain or workgroup move, a Windows update, or a service that no longer starts.
The event log matters more than any other single check. SQL Server master-database corruption is a real consequence of a power loss on a running machine, but until the log or SQL diagnostics name it, it is only a hypothesis — do not rebuild the database while the evidence still points at project configuration.
Reset WinCC and recreate the DCF file #
Work these steps in order and test the project in WinCC Explorer after each:
- Run
reset_wincc.vbson the affected station, restart the computer, and try to open the project. This alone has cleared the error on stations with this exact symptom. - If the error remains, close the WinCC project and open the project folder. Find the file named for the project with the
.dcfextension — the distributed configuration file, which tells the WinCC processes where each one gets its data. - Stop the SQL Server (WINCC) service in Windows services, delete the project's
.dcffile, then restart the service. - Reopen the project in WinCC Explorer. WinCC recreates the DCF, and the project should open without the access error.
- Verify Autostart can bring the project up without the original complaint before declaring the station fixed.
Working the sequence on a v6.2 SP2 multiproject after power loss #
A concrete case, with the inputs as reported on an engineering station of this kind:
- Inputs. SIMATIC WinCC v6.2 SP2 on an engineering station that also runs the project; a building power interruption; a multiproject with a configured OS project path; Autostart configured and unchanged; error text "Microsoft SQL Server can't access the database, please check the access rights" on opening WinCC Explorer.
- Rule. Test the cheapest, most reversible recovery first: a WinCC state reset, then regeneration of the project's distributed configuration file. Change rights or recover the database only when both fail or the event log names a database fault.
- Sequence. Run
reset_wincc.vbs, reboot — project still fails to open. Stop the SQL Server (WINCC) service, delete[project name].dcffrom the project folder, restart the service, reopen the project in WinCC Explorer. - Result. WinCC recreates the
.dcffile on open, the project opens, and Autostart starts the runtime without the access error. - Decision. With a clean Application event log and a project that opens after DCF recreation, the cause was the distributed configuration file, not the database or the access rights — leave the groups, shares and SQL instance as they are.
If your own station follows the same path, the same decision applies. If it fails earlier — at step 1 rather than step 4 — move to the checks below.
Check station access and network configuration #
If resetting WinCC and recreating the DCF does not restore access, work this list on the affected station:
- Was the computer name altered, or does it contain special characters? Restore the original name if it changed.
- Were the DCOM and firewall settings applied through SIMATIC Security Control? If yes, run SIMATIC Security Control again on this station. With the Windows Firewall enabled, WinCC requires the security configuration to be run and adapted there — it is the only firewall approved for WinCC operation.
- Is the computer in the correct workgroup or domain?
- Does the active user belong to the required SIMATIC HMI group and a SQL group, with at least Power User authorization? Use Administrator authorization while diagnosing.
- Are the servers visible in SimaticShell? Right-click SimaticShell and select Update to refresh the available servers.
- Is the terminal bus at the topmost position in the network configuration?
- Is the \WINCC SQL instance selected and loaded in SQL Manager?
- Is simple file sharing disabled, and does the shared project folder grant the user full rights?
A related but distinct fault class is a client that loses its SQL Server connection while the server itself runs; the checks in reconnect an edge PC to SQL Server after connection loss cover that path. If you later need to read runtime data through the WinCC runtime database via an ODBC DSN, confirm the station opens the project normally first, because a recreated DCF changes nothing about the archive tables.
When the database itself is damaged #
If the Application event log reports SQL Server database damage — for example errors pointing at the master database after the power loss — stop changing access rights and escalate to database recovery using the vendor's documented restore procedure and your own backups. Likewise, if every configuration check passes and the station still cannot open the project, the last recovery step is to redeploy: save any required online server data, remove the complete OS project from the target station, perform a full OS compile, and complete a full OS download.
One safety note: a WinCC station on a machine that will run again must come back with all its interlocks and runtime configuration intact. Do not put a recovered station back into production on the strength of a project that merely opens — confirm the runtime picture, alarms and archive logging behave as they did before the power loss.
Decision summary #
- Project opens after
reset_wincc.vbsand a reboot. The WinCC station state was the cause; verify Autostart and stop there. - Project opens after deleting the
.dcffile. The distributed configuration file was the cause; WinCC recreated it, and no rights change is needed. - Access error remains, event log clean. Work the station identity, group membership, SIMATIC Security Control and network checks in order.
- Application log reports database damage. Escalate to SQL database recovery; do not rebuild access rights blindly.
Questions asked
What is the WinCC DCF file and is it safe to delete?
The .dcf file is the distributed configuration file. It stores the information each WinCC process uses to find its data. WinCC recreates it when the project is reopened, so deleting it does not remove tags, archives or scripts. Stations that also use the Data Monitor Excel add-in often need the matching .dc_bak file removed after an upgrade as well.
Do I have to stop the SQL Server (WINCC) service before deleting the DCF file?
Stations that recovered this way stopped the service first, deleted the project's .dcf file, and restarted the service. The person who documented that recovery could not confirm the stop was required, only that it worked. Stopping the service first is a reasonable precaution and is what to repeat on your own station.
How do I tell a configuration fault from real database damage?
Read the Windows Application event log on the station. If it shows SQL Server errors naming the master database or file-level damage, escalate to database recovery before touching rights. If the log is clean or shows only project-open failures, the fault is in WinCC state or project configuration, and the reset and DCF path applies.
Why does a computer name change break WinCC database access?
WinCC project data is tied to the station name, and SQL access rights are granted through the local SIMATIC HMI and SQL groups on that named machine. If the computer name changed, or gained special characters, the project can no longer match its configuration, and the access error appears even though the database itself is intact.