FIX: "Not Enough Memory" Error with SQLCOLUMNS() and SQL Server

ID: Q224989


The information in this article applies to:


SYMPTOMS

In some cases, using the SQLColumns() function against a SQL Server table causes the following error:

There is not enough memory to complete this operation.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3.

For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

Q194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

Q194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed


MORE INFORMATION

In the code below, the cconstring holds the following values for each parameter:

Driver=SQL Server
Server=Your SQL Server name
UID=Your user ID
PWD=Your password (can be blank for no password)
APP=Microsoft® Visual FoxPro®
WSID=Workstation ID
DATABASE=The database name on SQL Server.

Steps to Reproduce Behavior

NOTE: You might need to alter the syntax of the cconstring variable to obtain a valid connection to SQL Server.
  1. Create a program that contains the following code and save it:


  2. 
    CLOSE DATA ALL
    cconstring = "DRIVER=SQL Server;SERVER=SPHINXSQL;UID=sa;PWD=;APP=Microsoft® Visual FoxPro®;WSID=WS2;DATABASE=pubs"
    PUBLIC hand
    SET SAFETY OFF
    DELETE FILE testdb.DBC
    DELETE FILE testdb.dc?
    CREATE DATA testdb
    CREATE CONNECTION testconn CONNSTRING (cconstring)
    
    hand=SQLCONNECT("testconn")
    
    ?hand
    ?SQLColumns(hand,"Publishers","FoxPro","curFields") < 0
    *?SQLColumns(hand,"Publishers","FoxPro","curFields")
    ?sqldisconnect(hand)
     
  3. Run the program.


After the program runs, you get the error:
There is not enough memory to complete this operation.
Note that the error does not occur every time you use the SQLColumns() function. In the example, if you change this line of code:

?SQLColumns(hand,"Publishers","FoxPro","curFields") < 0 
to this line:

?SQLColumns(hand,"Publishers","FoxPro","curFields") 
the code runs without error.

Additional query words:


Keywords          : kbDatabase kbODBC kbSQL kbVFp600 kbVFp600bug KbDBFDBC kbVS600sp3fix kbGrpFox 
Version           : WINDOWS:3.0b,5.0,5.0a,6.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: May 25, 1999