Visual Foxpro (SQL Error) Corrupted Indexes

posted Oct 11, 2013, 2:36 PM by Andrew Chadick   [ updated Nov 5, 2013, 7:36 AM ]
If your Visual Foxpro files are stored on a Windows 2008, R2, or 2012 File Server, you may be running in to a known issue with SMB Protocol (Server Configuration) Version 2 and 3.

According to several online sources; you must disable protocol 2 and 3 on the server in order to keep your compound index files from corrupting. However, disabling 2 and 3 has the side effect of breaking 2012 File shares through drive letter mapping. 

So, what I have figured out after a week of messing around with Server 2012, SMB 2/3 protocols, and various registry hacks, is that the changes that need to be made aren't on the server at all.

Everything to fix this issue of corrupting CDX files that needs to happen is on the workstation.  

Here is what you do -

Open PowerShell as Administrator on each workstation- Then Run these Commands (Applies to Win 7/8 Workstation):
sc.exe config lanmanworkstation depend= bowser/mrxsmb10/nsi
sc.exe config mrxsmb20 start= disabled

Then run REGEDIT and modify the registry on each workstation in the network:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters]
"SMB2"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters]
"EnableOpLocks"=dword:00000000

Once you have those registry changes made, reboot, and bring it up.  
No more corrupted CDX files.
This will most likely work with any flat file database that is shared across a network on 2012 Server.

Comments