Microsoft KB Archive/224989

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

Article ID: 224989

Article Last Modified on 11/1/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q224989



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 that this is a problem in the Microsoft products that are listed in the "Applies to" section 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:

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

194295 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

APP=Microsoft(r) Visual FoxPro(r)

WSID=Workstation ID

DATABASE=The database name on SQL Server.

Steps to Reproduce Behavior
You might need to alter the syntax of the cconstring variable to obtain a valid connection to SQL Server.

Note The user,, must have permissions to perform these operations on the database.   Create a program that contains the following code and save it: CLOSE DATA ALL cconstring = "DRIVER=SQL Server;SERVER=SPHINXSQL;UID=UserName;PWD=StrongPassword;APP=Microsoft(r) Visual FoxPro(r);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 ?sqldisconnect(hand)
 * ?SQLColumns(hand,"Publishers","FoxPro","curFields")

 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.

Keywords: kbbug kbfix kbsqlprog kbdatabase kbvs600sp3fix KB224989

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.