PRB: Exception Error When Using ODBC to SQL Server via TCP/IP

This article was previously published under Q135874
This article has been archived. It is offered "as is" and will no longer be updated.
When creating a remote view to a SQL server using TCP/IP sockets installedwith the SQL Server Client Software version 4.21a, the following occurs:

  • A Win32s error is displayed.

  • The product shuts down without any error message.
This occurs with TCP/IP sockets or IPX/SPX. It does not happen with namedpipes.
When Visual FoxPro connects to a data source and sends data, it uses a 4Kpacket size by default. This default packet size causes errors when usingTCP/IP with SQL Server and ODBC. The ODBC default is usually 512 bytes.
To work around this behavior, modify the default packet size that VisualFoxPro uses. You can achieve this by creating a connection, changing thePacketSize property of the connection, and creating the remote view againstthe connection.

The following procedure explains how to get a connection and modify itsattributes:

  1. Open a database. To create a connection, click New and then Connection on the File menu. This opens the Connection Designer.
  2. Set the attributes for the connection, and save it as myconnection.
  3. In the Command window, type:
    This saves the PacketSize property in the database. If you want to modify the packet size for the current session only, use the SQLSETPROP() function as follows:
Microsoft is researching this behavior and will post new information herein the Microsoft Knowledge Base as it becomes available.

Steps to Reproduce Behavior

  1. Install TCP/IP Protocol.
  2. Install the SQL Server 4.21a Client Software. (This is necessary in order to get the required dll - Dbmssoc3.dll.) Switch the Protocol from named pipes to TCP/IP.
  3. In the Autoexec.bat add C:\SQL and C:\SQL\BIN to the path. This step is necessary for the ODBC driver manager to find Dbmssoc3.dll. Without this added to the path, you will receive this error message:

    Driver unable to load communication module. Driver has not been correctly installed.
  4. Reboot.
  5. Start Windows and go into the ODBC Driver Manager. Configure the driver.
  1. Start Visual FoxPro, and create a database. In the database, create a Remote View based off FoxHole_tcp.
  2. Log in.
A TCP/IP socket is an addressable point that consists of an IP address anda TCP or UPD port number. It provides applications access to TCP/IPprotocols.

A Named pipe is a communication API that provides a software connectionbetween a client and a server.

For more information about using TCP/IP named piped versus sockets, pleasesee the following article in the Microsoft Knowledge Base:
128985 Comparing SNA Client TCP/IP Named Piped vs Sockets

Article ID: 135874 - Last Review: 02/28/2014 07:58:17 - Revision: 2.3

  • Microsoft Visual FoxPro 3.0 Standard Edition
  • Microsoft Visual FoxPro 6.0 Professional Edition
  • Microsoft Data Access Components 2.5
  • kbnosurvey kbarchive kbprb KB135874