WinCC Flexible SQLDMO Server Class Initialization Error: Repair Procedure
The "Cannot initialize SQLDMO server class" message is one of the most persistent startup faults encountered on engineering stations running WinCC Flexible 2005 / 2007 / 2008 on Windows XP Professional SP2 (and on early Windows 7 configurations where compatibility layers are still in use). The fault is not caused by WinCC Flexible itself in 95 % of cases; it is triggered by the embedded Microsoft SQL Server 2000 Desktop Engine (MSDE) instance that WinCC Flexible uses for project, recipe, and audit storage. When the MSDE instance is corrupt, unregistered, or its supporting COM layer (SQLDMO.dll) is missing, WinCC Flexible cannot initialize its database layer and refuses to open or create any project.
This reference documents the official Siemens three-step remediation from the WinCC Flexible Readme, the underlying architecture of the failure, the prerequisite check that prevents recurrence, and the verification commands that confirm the fix. It is intended for commissioning engineers, service technicians, and system integrators working with SIMATIC HMI configuration workstations.
1. Problem Definition
When WinCC Flexible is launched, or when a new project is being created, the following dialog appears:
Cannot initialize SQLDMO server class.
This usually indicates a corrupt Database installation.
Try to reinstall the WinCC flexible database server (see Readme)
The dialog originates from the WinCC Flexible project database access layer. It can occur in three operational states:
| State | Trigger | Frequency |
|---|---|---|
| Cold install | Engineering PC rebuilt, STEP 7 / ProTool / WinCC Flexible installed in wrong order, or admin rights missing | High |
| After STEP 7 / WinCC update | STEP 7 V5.4 + SP1 (K5.4.1.0) and similar updates touching shared MSDE / MDAC components | Moderate |
| After SQL Server tool removal | Microsoft SQL Server 2000 tools, MSXML, or MDAC uninstalled by another application | Moderate |
| After Windows security patching | KB updates replace SQLDMO.dll, sqlunirl.dll, or sqlsrv32.dll with newer revisions incompatible with MSDE 8.0.760 |
Low |
2. Root Cause Analysis
WinCC Flexible 2005 and 2007 do not use a full SQL Server. They bundle Microsoft SQL Server 2000 Desktop Engine (MSDE), version 8.00.760 or later, installed as a named instance with the literal identifier:
MSSQL$WINCCFLEXIBLE
The instance stores project files, library objects, recipes, logs, and audit trails. Communication between the WinCC Flexible front-end and MSDE goes through:
- SQLDMO.dll — SQL Distributed Management Objects (COM). Provides the COM-callable surface used by the WinCC Flexible engineering front-end and by Hmies.exe (the HMI engineering service executable).
- SQLSRV32.dll — the SQL Server ODBC driver.
- SQLUNIRL.dll — the SQL Server Unicode layer.
- MSADO15.dll / msado21.tlb — ADO 2.1 dependencies referenced from the WinCC Flexible project loader.
When the COM registration of SQLDMO.dll fails (missing registry keys under HKEY_CLASSES_ROOT\SQLDMO.Application or missing file), when the MSDE named instance is not registered as a Windows service, or when the master / msdb / tempdb system databases of MSSQL$WINCCFLEXIBLE are damaged, the SQLDMO call from WinCC Flexible returns E_FAIL and the dialog is raised.
2.1 Files and Registry Keys to Verify
| Component | Path | Expected State |
|---|---|---|
| MSDE instance root | %programfiles%\Microsoft SQL Server\MSSQL$WINCCFLEXIBLE |
Folder exists, contains Data, Binn, Install
|
| MSDE shared runtime | %programfiles%\Microsoft SQL Server\80 |
Folder exists with Binn/Tools/Com subfolders (only if no other SQL instance present) |
| SQLDMO.dll | %programfiles%\Microsoft SQL Server\80\Tools\Binn\SQLDMO.dll |
Present, version 2000.80.x.x |
| WinCC Flexible service | Registry: HKLM\SYSTEM\CurrentControlSet\Services\MSSQL$WINCCFLEXIBLE
|
Service exists, ImagePath points to sqlservr.exe
|
| SQLDMO COM class | Registry: HKCR\CLSID\{10020200-E260-11CF-AE68-00AA004A34D5}
|
InProcServer32 references SQLDMO.dll |
| SQLDMO.Application ProgID | Registry: HKCR\SQLDMO.Application
|
CLSID referenced |
3. Prerequisites for Repair
Before touching the SQL layer, confirm the following. Skipping these is the single most common reason the error returns after a successful reinstall:
-
Local Administrator rights on the engineering PC. Standard users cannot register COM components or write to
%programfiles%\Microsoft SQL Server. - Internet Explorer 6.0 or higher installed. WinCC Flexible relies on IE6+ for HTML-based help, MSI bootstrapper, and MDAC installation hooks.
-
File and Printer Sharing for Microsoft Networks enabled on the LAN adapter. MSDE uses named pipes (
\\.\pipe\sql\query) but the WinCC Flexible bootstrap verifies that NetBIOS / SMB is bound before allowing install to proceed. - Message Queuing Services (MSMQ) installed and started. WinCC Flexible 2005 SP1+ uses MSMQ for distributed audit-log fan-out. Without it, the install routine can roll back partially and leave the SQL instance half-installed.
-
Installation order strictly enforced on green-field installs:
STEP 7 → ProTool (legacy projects) → WinCC Flexible. STEP 7 V5.4 + SP1 (K5.4.1.0) and similar updates are known to disturb the SQLDMO COM registration; always reinstall WinCC Flexible after such an update. -
All WinCC Flexible CDs available, in particular CD_2 which carries the MSDE image under
WinCCflexible\setup\MSDE\disk1\Setup.exe.
4. Step-by-Step Repair Procedure
The Siemens Readme procedure is a strict three-step sequence. Steps must be executed in this order, with a reboot between each cluster where indicated. The full procedure is reproduced and annotated below.
4.1 Step 1 — Uninstall the WinCC Flexible instance of MSDE
- Insert CD_2 of the WinCC Flexible installation set into the CD drive. Note the drive letter; the example below uses
D:. - Open Start → Run…, type
cmd, and press Enter. - Switch to the CD and descend into the MSDE installation folder:
D:\> cd D:\WinCCflexible\setup\MSDE\disk1 D:\WinCCflexible\setup\MSDE\disk1> - Execute the uninstall routine. The
/z"UTAH_U"switch is the MSDE Setup install-time property that signals Unattended Uninstall of the named UTAH-coded (SQL Server 2000) instance:D:\WinCCflexible\setup\MSDE\disk1> Setup.exe /z"UTAH_U" - Wait for the dialog "Uninstall completed successfully" (or its unattended equivalent exit code). Do not interrupt.
Setup.exe /z"UTAH_U" line for both the uninstall and the install steps. Treat the Readme as authoritative for the command line that ships with your CD revision; if your Readme's install step uses a different property (commonly Setup.exe /z"UTAH_I" for an install pass, or Setup.exe /x /z"UTAH_U" for an explicit uninstall), use whatever is printed in your copy. Do not invent switches.
4.2 Step 2 — Delete residual installation elements
The MSDE uninstall routine sometimes leaves the data, log, and registry folders behind. These leftovers will be detected by the fresh installer and block the install with a "Setup has detected a previous installation" error. Remove them as follows:
- From the same elevated
cmdwindow, change to the SQL Server program folder:C:\> cd "%programfiles%\Microsoft SQL Server" C:\Program Files\Microsoft SQL Server> - If this folder no longer exists, the uninstall completed fully. Skip to Step 4.3.
- If the folder is present, delete the WinCC Flexible instance folder recursively and silently:
C:\Program Files\Microsoft SQL Server> rd /s /q MSSQL$WINCCFLEXIBLE - Inspect the
80subfolder. Only delete it if it contains no other entries. If80is shared with another SQL product (a separate WinCC instance, a third-party SQL tool, etc.) leave it alone — removing shared runtime files breaks the other instance:C:\Program Files\Microsoft SQL Server> dir 80 - Optionally, remove the orphaned service registration:
Use this only if the service still appears inC:\> sc delete MSSQL$WINCCFLEXIBLEservices.mscafter the uninstall. - Reboot the engineering PC to ensure the Windows Service Control Manager releases any locks on
sqlservr.exeimage handles.
4.3 Step 3 — Reinstall the WinCC Flexible instance of MSDE
- Return to the MSDE setup folder on CD_2:
C:\> D: D:\> cd WinCCflexible\setup\MSDE\disk1 D:\WinCCflexible\setup\MSDE\disk1> - Run the setup. Per the WinCC Flexible Readme, the same
UTAH_Uproperty string is used on the install pass on certain CD revisions. Use the command that matches your Readme. The typical install command is:D:\WinCCflexible\setup\MSDE\disk1> Setup.exe /z"UTAH_U" - The setup copies the MSDE binaries, creates the
MSSQL$WINCCFLEXIBLEinstance, attachesmaster,model,msdb,tempdb, and registersSQLDMO.dll. - If the install fails partway, the setup log is written to
%windir%\sqlstp.logand%windir%\setupapi.log. Both should be reviewed before re-running. - Reboot when prompted.
5. Verification Procedure
After the reboot, validate the fix from the Windows command line before launching WinCC Flexible:
-
Service is registered and started:
C:\> sc query MSSQL$WINCCFLEXIBLE SERVICE_NAME: MSSQL$WINCCFLEXIBLE TYPE : 10 WIN32_OWN_PROCESS STATE : 4 RUNNING -
SQLDMO.dll is registered as a COM server:
C:\> regsvr32 "%programfiles%\Microsoft SQL Server\80\Tools\Binn\SQLDMO.dll" DllRegisterServer in SQLDMO.dll succeeded.If the registration reports a missing dependency (typically
sqlunirl.dllormsvcrt.dll), copy the dependency from the CDWinCCflexible\setup\MSDE\disk1path into%programfiles%\Microsoft SQL Server\80\Tools\Binnand re-register. -
ODBC connectivity to the named instance works:
C:\> osql -S .\WINCCFLEXIBLE -E 1> SELECT @@VERSION 2> goExpected output: Microsoft SQL Server 2000 - 8.00.XXXX (Desktop Engine) followed by the build date. The
-Eflag uses Windows authentication;osql.exeis shipped in the MSDEBinnfolder. - WinCC Flexible launches without the dialog: start the WinCC Flexible ES, choose File → New, and create a temporary project. If the project wizard reaches the device-selection screen without re-raising the SQLDMO dialog, the fix is complete.
6. Alternative Repair Methods
If the three-step Siemens procedure does not resolve the fault, the following supplementary actions are typically deployed by service technicians in the order listed.
6.1 Re-register SQLDMO and dependent COM libraries
regsvr32 /u "%programfiles%\Microsoft SQL Server\80\Tools\Binn\SQLDMO.dll"
regsvr32 "%programfiles%\Microsoft SQL Server\80\Tools\Binn\SQLDMO.dll"
regsvr32 "%programfiles%\Microsoft SQL Server\80\Tools\Binn\SQLUNIRL.dll"
regsvr32 "%programfiles%\Common Files\System\Ole DB\oledb32.dll"
6.2 Repair the MDAC (Microsoft Data Access Components) stack
WinCC Flexible 2005 depends on MDAC 2.8 SP1. A damaged MDAC stack can be repaired without uninstalling SQL Server by downloading and re-running the MDAC Component Checker from Microsoft, which detects and re-registers missing MDAC DLLs. After the repair, re-run the SQLDMO registration step above.
6.3 Clean the residual user database files
If the previous MSDE instance left orphaned .mdf / .ldf files under %programfiles%\Microsoft SQL Server\MSSQL$WINCCFLEXIBLE\Data, the new installer may attach them and fail on a version mismatch. Move the entire Data folder aside before reinstall:
move "%programfiles%\Microsoft SQL Server\MSSQL$WINCCFLEXIBLE\Data" "%programfiles%\Microsoft SQL Server\MSSQL$WINCCFLEXIBLE\Data.bak"
6.4 Escalation path
If the procedure still does not resolve the fault, escalate to the Siemens Industrial Online Support portal with:
- The full
%windir%\sqlstp.logfrom both the failed and successful install attempts. - The
services.mscscreenshot of the MSSQL$WINCCFLEXIBLE service entry. - The output of
osql -S .\WINCCFLEXIBLE -E -Q "SELECT @@VERSION". - The Windows event log (Application channel, filter by source
MSSQL$WINCCFLEXIBLE).
The SIMATIC hotline can provide a manual Microsoft SQL Server installation recipe (separate from the MSDE bundle) tailored to WinCC Flexible; this is referenced in the original Siemens support correspondence and is the recommended escalation route for repeated failures.
7. Troubleshooting Matrix
| Symptom after repair | Likely cause | Action |
|---|---|---|
| Service won't start, error 3417 / 1722 | Corrupted master database | Move Data.bak aside (section 6.3), reinstall MSDE |
| Service starts but SQLDMO dialog reappears | SQLDMO.dll not re-registered | Run regsvr32 SQLDMO.dll as admin |
| Install hangs at 80 % | File & Print Sharing disabled, or MSMQ missing | Enable both, restart setup |
| Install completes but WinCC Flex still says SQLDMO | Wrong CD revision (mix of 2005 + 2007 media) | Verify CDs match the installed WinCC Flexible build |
| Error after STEP 7 V5.4 + SP1 update | STEP 7 update replaced SQLDMO.dll with non-WinCC-compatible revision |
Reinstall WinCC Flexible entirely after STEP 7 update |
| XP Pro SP3 specific | SP3 replaces DCOM config that WinCC Flex relied on | Restore DCOM defaults: dcomcnfg → Default Authentication → Connect → Default |
8. Prevention and Long-Term Hygiene
- Document the install media revision of every WinCC Flexible CD in the engineering-station handover pack; mismatched CDs are a recurring fault source.
- Avoid installing other Microsoft SQL Server versions on the same engineering PC. MSDE 2000 and SQL Server 2005/2008 Express can coexist in principle, but the SQLDMO COM class from MSDE 2000 is the one WinCC Flexible loads, and a newer install can shadow the COM registration.
- After any Windows servicing update that lists
SQLDMO.dll,sqlsrv32.dll,sqlunirl.dll, ormsado15.dllin its manifest, re-run the SQLDMO re-registration (section 6.1). - Take a disk-image snapshot of the engineering PC immediately after a clean, fully-working WinCC Flexible install; rollback from such an image is faster than re-running the SQLDMO procedure.
- For audit-bound applications, enable MSMQ before the first WinCC Flexible project is created. Adding it later requires project-side re-configuration.
9. Cross-Reference: Related WinCC Flexible Database Errors
The following SQLDMO-adjacent error strings can be resolved with the same three-step procedure, but each has a distinct nuance:
| Error text | Specific cause |
|---|---|
| "Hmies.exe — application error" at WinCC Flex start | WinCC Flexible engineering service binary mismatched with MSDE build |
"Cannot find object MSSQL$WINCCFLEXIBLE" from osql
|
Instance never installed or was renamed by an SQL 2005+ Express install |
| "The database 'master' is not accessible" | Section 6.3 required — leftover master.mdf from a prior install |
| "SQL Server does not exist or access denied" | Service not running; sc start MSSQL$WINCCFLEXIBLE
|
10. Summary Checklist
- [ ] Confirm administrator rights, IE6+, File & Print Sharing, MSMQ
- [ ] Insert WinCC Flexible CD_2
- [ ] Step 1 — uninstall:
Setup.exe /z"UTAH_U"fromWinCCflexible\setup\MSDE\disk1 - [ ] Step 2 — delete
MSSQL$WINCCFLEXIBLEinstance folder, conditionally delete80 - [ ] Reboot
- [ ] Step 3 — reinstall:
Setup.exefrom the same path - [ ] Reboot
- [ ] Verify:
sc query,regsvr32,osql -E, WinCC Flex project creation
FAQ
What does "Cannot initialize SQLDMO server class" mean in WinCC Flexible 2005?
It means the COM layer (SQLDMO.dll) used to talk to the bundled Microsoft SQL Server 2000 Desktop Engine (MSDE) named instance MSSQL$WINCCFLEXIBLE failed to load. The WinCC Flexible engineering front-end cannot open or create projects until that COM layer and the underlying MSDE instance are repaired.
Which exact command removes the MSDE instance from the WinCC Flexible CD_2?
From D:\WinCCflexible\setup\MSDE\disk1 (substituting the actual CD drive letter), run Setup.exe /z"UTAH_U". Then delete %programfiles%\Microsoft SQL Server\MSSQL$WINCCFLEXIBLE with rd /s /q, reboot, and run the install command from the same folder per your Readme's revision.
Do I have to uninstall WinCC Flexible itself to fix this error?
No. The MSDE instance that WinCC Flexible ships with can be uninstalled and reinstalled independently using the three-step Readme procedure. Only the named instance MSSQL$WINCCFLEXIBLE and (if empty) the shared 80 folder are touched. This is the recommended approach before escalating to the SIMATIC hotline.
Why does the SQLDMO error come back after a STEP 7 V5.4 + SP1 update?
STEP 7 V5.4 + SP1 (K5.4.1.0) and similar updates touch shared MDAC / SQL files that WinCC Flexible also uses. After applying such an update, always reinstall the WinCC Flexible MSDE instance (Step 3 of the procedure) and re-register SQLDMO.dll with regsvr32.
How do I confirm the MSDE named instance is running after the repair?
From a Windows command prompt run sc query MSSQL$WINCCFLEXIBLE — the STATE must be RUNNING. Then run osql -S .\WINCCFLEXIBLE -E -Q "SELECT @@VERSION" from %programfiles%\Microsoft SQL Server\80\Tools\Binn. The returned version string should report Microsoft SQL Server 2000 Desktop Engine, confirming the instance is healthy.