FIX: You receive an error message when you use Microsoft OLE DB Provider for Visual FoxPro in SQL Server (908915)



The information in this article applies to:

  • Microsoft Visual FoxPro 9.0 Professional Edition
  • Microsoft Visual FoxPro 8.0 SP1
  • Microsoft Visual FoxPro 8.0
  • Microsoft Visual FoxPro for Windows 7.0 SP1
  • Microsoft Visual FoxPro for Windows 7.0
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2000 Enterprise Edition
  • Microsoft SQL Server 2000 Standard Edition

SYMPTOMS

Consider the following scenario:
  • In Microsoft SQL Server, you use Microsoft OLE DB Provider for Visual FoxPro as a linked server by using the OPENQUERY function or the OPENROWSET function.
  • In SQL Server, you configure Microsoft OLE DB Provider for Visual FoxPro to run in-process.
  • You run repeated queries that return many rows and columns.
In this scenario, you receive an error message that is similar to the following:
Server: Msg 7346, Level 16, State 2, Line 7 Could not get the data of the row from the OLE DB provider 'vfpoledb'. Could not convert the data value due to reasons other than sign mismatch or overflow. OLE DB error trace [OLE/DB Provider 'vfpoledb' IRowset::GetData returned 0x40eda: Data status returned from the provider: [COLUMN_NAME=f100 STATUS=DBSTATUS_S_OK], [COLUMN_NAME=f99 STATUS=DBSTATUS_S_OK], [COLUMN_NAME=f98 STATUS=DBSTATUS_S_OK], [COLUMN_NAME=f97 STATUS=DBSTATUS_S_OK], [COLUMN_NAME=f96 STATUS=DBSTATUS_S_OK], [COLUMN_NAME=f95 STATUS=DBSTATUS_S_OK], [COLUMN_NAME=f94 STATUS=DBSTATUS...
When the memory in the SQL Server MemToLeave region is exhausted, you may receive error messages that are similar to the following:
Server: Msg 701, Level 17, State 1, Line 8 There is insufficient system memory to run this query.

CAUSE

This problem occurs because of a memory leak in Microsoft OLE DB Provider for Visual FoxPro. Memory that is allocated by the provider is not released. The memory leak may eventually cause the memory in the SQL Server MemToLeave region to be exhausted.

RESOLUTION

Hotfix information

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Visual FoxPro 9.0 service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version     Size       File name
   -------------------------------------------------------
   14-Sep-2005  21:45  9.0.0.3314  1,773,568  Vfpoledb.dll     
   14-Sep-2005  23:44                844,800  Vfpoledb.msm

WORKAROUND

Install the hotfix version of the Microsoft OLE DB Provider for Visual FoxPro in this article, and then configure the provider to run inside the SQL Server process. To do this, use the Allow InProcess setting. By default, the OLE DB Provider for Visual FoxPro runs out-of-process. Alternatively, you can work around this problem in previous versions of the Microsoft OLE DB Provider for Visual FoxPro. To do this, configure the Microsoft OLE DB Provider for Visual FoxPro to run outside the SQL Server process. Do not use the Allow InProcess setting. Although this workaround prevents the memory leak, data throughput is usually much lower.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

The memory leak occurs when memory is allocated for the result set. The size of the memory leak is the number of bytes for each character field plus 1 byte for each character field in the Visual FoxPro source table multiplied by the number of rows in the result set. The memory leak may eventually cause the memory in the SQL Server MemToLeave region to be exhausted. You can reclaim the memory in the SQL Server MemToLeave region only by stopping and then restarting the SQL Server service.

Steps to reproduce the problem

To reproduce this problem, you must have SQL Server and Microsoft OLE DB Provider for Visual FoxPro installed on the computer.
  1. In SQL Server, configure Microsoft OLE DB Provider for Visual FoxPro to run in-process. To do this, follow these steps:
    1. In SQL Server Enterprise Manager, expand Microsoft SQL Servers, expand SQL Server Group, and then expand the instance of SQL Server that you want.
    2. Expand Security.
    3. Right-click Linked Servers, and then click New Linked Server.
    4. In the Linked Server Properties dialog box, click Other data source under Server type.
    5. In Provider name, click Microsoft OLE DB Provider for Visual FoxPro.
    6. Click Provider Options.
    7. In the Provider Options dialog box, click to select the Allow InProcess check box, click Apply, and then click OK.
    8. In the Linked Server Properties dialog box, click Cancel.

      Note If you click OK, you receive an error message that states that you must specify a name.
  2. On the computer that is running SQL Server, create the following folder:

    c:\vfptestdata\

  3. Start SQL Query Analyzer.
  4. Connect to the instance of SQL Server that you used in step 1.
  5. In SQL Query Analyzer, run the following script to create a test table and to add data to the test table.
    SELECT * 
    	FROM OPENROWSET('vfpoledb', 
    	   'c:\vfptestdata\';'';'',
    	   'create table testtab1 (
    		f1 c(200), f2 c(200), f3 c(200), f4 c(200), f5 c(200), 
    		f6 c(200), f7 c(200), f8 c(200), f9 c(200), f10 c(200),
    		f11 c(200), f12 c(200), f13 c(200), f14 c(200), f15 c(200),		
    		f16 c(200), f17 c(200), f18 c(200), f19 c(200), f20 c(200),
    		f21 c(200), f22 c(200), f23 c(200), f24 c(200), f25 c(200),		
    		f26 c(200), f27 c(200), f28 c(200), f29 c(200), f30 c(200),
    		f31 c(200), f32 c(200), f33 c(200), f34 c(200), f35 c(200),		
    		f36 c(200), f37 c(200), f38 c(200), f39 c(200), f40 c(200),
    		f41 c(200), f42 c(200), f43 c(200), f44 c(200), f45 c(200),		
    		f46 c(200), f47 c(200), f48 c(200), f49 c(200), f50 c(200),
    		F51 c(200), f52 c(200), f53 c(200), f54 c(200), f55 c(200), 
    		f56 c(200), f57 c(200), f58 c(200), f59 c(200), f60 c(200),
    		f61 c(200), f62 c(200), f63 c(200), f64 c(200), f65 c(200),		
    		f66 c(200), f67 c(200), f68 c(200), f69 c(200), f70 c(200),
    		f71 c(200), f72 c(200), f73 c(200), f74 c(200), f75 c(200),		
    		f76 c(200), f77 c(200), f78 c(200), f79 c(200), f80 c(200),
    		f81 c(200), f82 c(200), f83 c(200), f84 c(200), f85 c(200),		
    		f86 c(200), f87 c(200), f88 c(200), f89 c(200), f90 c(200),
    		f91 c(200), f92 c(200), f93 c(200), f94 c(200), f95 c(200),		
    		f96 c(200), f97 c(200), f98 c(200), f99 c(200), f100 c(200)
    		)')
    
    go
    
    set nocount on
    
    DECLARE @cnt int
    SET  @cnt = 1
    WHILE (@cnt <= 2000)
    BEGIN
     	if @cnt % 200 = 0
    		begin		
    			print @cnt
    		end
    	SET  @cnt = @cnt + 1
    	insert into OPENROWSET('vfpoledb', 
       'c:\vfptestdata\';'';'',
       'use testtab1')
    	(f1) values ('abcdefghi') 
    END
    
    set nocount off
    
    go
  6. In SQL Query Analyzer, run the following script.
    DECLARE @cnt int
    SET  @cnt = 1
    WHILE (@cnt <= 100)
    BEGIN
    	print @cnt
    	SET  @cnt = @cnt + 1
    	SELECT * 
    		FROM OPENROWSET('vfpoledb', 
    	   'c:\vfptestdata\';'';'',
    	   'select * from testtab1')
    end
    
    go
    
  7. In Microsoft Windows Task Manager, click the Processes tab, and then view the Sqlservr.exe process when the script in step 6 runs. The value under Mem Usage steadily increases.
  8. In the Results pane of SQL Query Analyzer, click the Messages tab.
  9. In the Messages pane of SQL Query Analyzer, view the iteration count and the query result that are displayed after each iteration. After several iterations, you receive the following error message:
    Server: Msg 7346, Level 16, State 2, Line 8 Could not get the data of the row from the OLE DB provider 'vfpoledb'. Could not convert the data value due to reasons other than sign mismatch or overflow. OLE DB error trace [OLE/DB Provider 'vfpoledb' IRowset::GetData returned 0x40eda: Data status returned from the provider: [COLUMN_NAME=f100 STATUS=DBSTATUS_S_OK], [COLUMN_NAME=f99 STATUS=DBSTATUS_S_OK], [COLUMN_NAME=f98 STATUS=DBSTATUS_S_OK], [COLUMN_NAME=f97 STATUS=DBSTATUS_S_OK], [COLUMN_NAME=f96 STATUS=DBSTATUS_S_OK], [COLUMN_NAME=f95 STATUS=DBSTATUS_S_OK], [COLUMN_NAME=f94 STATUS=DBSTATUS...

Modification Type:MinorLast Reviewed:7/26/2006
Keywords:kbQFE kbpubtypekc KB908915 kbAudDeveloper kbAudITPRO