A C++ point of sale application using ADO to connect to a default instance of SQL Server is failing when the application is used on a tablet PC with a wireless card for networking.
The application works fine on the tablet when a LAN cable is connected.
The testing people discovered that another server application that uses SQL Server was having a similar problem until they changed the settings to use Shared Memory connection to the SQL Server instance rather than TCP connection.
The connect string that we are using is as follows:
"Provider=MSDASQL;DRIVER={SQL Server};SERVER=(local);DATABASE=%s;UID=; Password=;"
Reading this web page, it appears that in order to use shared memory connections, the SERVER=(local) keyword needs to specify SERVER=lpc:(local) however I am not sure of that.
The web page is SqlConnection.ConnectionString Property From Microsoft MSDN
After making the change to the connect string for both point of sale application and the inventory application to use the
SERVER=lpc:(local)keyword/value, the test team is no longer seeing a problem when the wireless cell card is being used.So the lpc: forces the use of shared memory.
See also this question on ADO Error 16389.
Addendum for another component of the solution (Oct-24-2016)
In the field sites that are using our point of sale we are also using Datacap Systems NETePay server to process Electronic Payment Transactions.
Due to the customer making a point of sale configuration error, since corrected, we recently discovered that the NETePay server ran into a similar problem. The XML response from the DSI Client-X control was an “Error” with an error code of 001501 and an error text that began “Database Error During ScratchWrite”.
Remembering this problem and the solution we modified the settings for the Datacap Systems SQL Server instance, changing “Protocols for DATCAPINSTANCE” by changing TCP/IP from “Enable” to “Disable”. After making this change the customer is no longer seeing the error.