WinCC Flexible SQLDMO Server Class Initialization Error: Repair

David Krause12 min read
SiemensTroubleshootingWinCC
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

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.

Why the message says "corrupt Database installation": the message is generated by WinCC Flexible's exception handler, not by MSDE itself. MSDE cannot tell a WinCC application that its COM wrapper failed; the WinCC code path catches the COM error and re-formats it. The root cause is therefore almost always the SQLDMO / MSDE layer, not a corrupted user project.

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:

  1. Local Administrator rights on the engineering PC. Standard users cannot register COM components or write to %programfiles%\Microsoft SQL Server.
  2. Internet Explorer 6.0 or higher installed. WinCC Flexible relies on IE6+ for HTML-based help, MSI bootstrapper, and MDAC installation hooks.
  3. 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.
  4. 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.
  5. 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.
  6. 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

  1. Insert CD_2 of the WinCC Flexible installation set into the CD drive. Note the drive letter; the example below uses D:.
  2. Open Start → Run…, type cmd, and press Enter.
  3. Switch to the CD and descend into the MSDE installation folder:
    D:\> cd D:\WinCCflexible\setup\MSDE\disk1
    D:\WinCCflexible\setup\MSDE\disk1>
  4. 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"
  5. Wait for the dialog "Uninstall completed successfully" (or its unattended equivalent exit code). Do not interrupt.
Field note: some copies of the WinCC Flexible 2005 Readme have been observed to print the identical 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:

  1. From the same elevated cmd window, change to the SQL Server program folder:
    C:\> cd "%programfiles%\Microsoft SQL Server"
    C:\Program Files\Microsoft SQL Server>
  2. If this folder no longer exists, the uninstall completed fully. Skip to Step 4.3.
  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
  4. Inspect the 80 subfolder. Only delete it if it contains no other entries. If 80 is 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
  5. Optionally, remove the orphaned service registration:
    C:\> sc delete MSSQL$WINCCFLEXIBLE
    Use this only if the service still appears in services.msc after the uninstall.
  6. Reboot the engineering PC to ensure the Windows Service Control Manager releases any locks on sqlservr.exe image handles.

4.3 Step 3 — Reinstall the WinCC Flexible instance of MSDE

  1. Return to the MSDE setup folder on CD_2:
    C:\> D:
    D:\> cd WinCCflexible\setup\MSDE\disk1
    D:\WinCCflexible\setup\MSDE\disk1>
  2. Run the setup. Per the WinCC Flexible Readme, the same UTAH_U property 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"
  3. The setup copies the MSDE binaries, creates the MSSQL$WINCCFLEXIBLE instance, attaches master, model, msdb, tempdb, and registers SQLDMO.dll.
  4. If the install fails partway, the setup log is written to %windir%\sqlstp.log and %windir%\setupapi.log. Both should be reviewed before re-running.
  5. Reboot when prompted.

5. Verification Procedure

After the reboot, validate the fix from the Windows command line before launching WinCC Flexible:

  1. Service is registered and started:
    C:\> sc query MSSQL$WINCCFLEXIBLE
    SERVICE_NAME: MSSQL$WINCCFLEXIBLE
            TYPE               : 10  WIN32_OWN_PROCESS
            STATE              : 4  RUNNING
  2. 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.dll or msvcrt.dll), copy the dependency from the CD WinCCflexible\setup\MSDE\disk1 path into %programfiles%\Microsoft SQL Server\80\Tools\Binn and re-register.

  3. ODBC connectivity to the named instance works:
    C:\> osql -S .\WINCCFLEXIBLE -E
    1> SELECT @@VERSION
    2> go

    Expected output: Microsoft SQL Server 2000 - 8.00.XXXX (Desktop Engine) followed by the build date. The -E flag uses Windows authentication; osql.exe is shipped in the MSDE Binn folder.

  4. 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.log from both the failed and successful install attempts.
  • The services.msc screenshot 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, or msado15.dll in 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" from WinCCflexible\setup\MSDE\disk1
  • [ ] Step 2 — delete MSSQL$WINCCFLEXIBLE instance folder, conditionally delete 80
  • [ ] Reboot
  • [ ] Step 3 — reinstall: Setup.exe from 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.

Back to blog