Microsoft KB Archive/314814

= You receive error 1073741819 in a VFP multi-threaded DLL when you use LIKE operator in SQL SELECT statement =

Article ID: 314814

Article Last Modified on 2/2/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 7.0 Professional Edition

-



This article was previously published under Q314814



SYMPTOMS
If you use Visual FoxPro 7.0 to build a multi-threaded DLL (MTDLL) that contains a procedure which performs a SQL SELECT statement that contains the LIKE operator, when you call the procedure, the MTDLL may fail with a C05 error and you receive the following error message:

OLE IDispatch exception code 5 from tstmtdll.SERVER tstmtdll.SERVER: .doselect C:\Test\dllmain.prg Error in line 4 -1073741819..



RESOLUTION
To resolve this problem, obtain the latest service pack for Visual FoxPro for Windows 7.0. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

316964 How to Obtain the Latest Visual FoxPro for Windows 7.0 Service Pack



STATUS
Microsoft has confirmed that this is a problem in Microsoft Visual FoxPro for Windows 7.0. This problem was first corrected in Visual FoxPro for Windows 7.0 Service Pack 1.



Steps to reproduce the behavior
 Create a new folder on your hard disk. Copy the files Vfp7t.dll and Vfp7enu.dll to the new folder. These files should be dated 6/14/2001 with a version number of 9262.  In Visual FoxPro 7.0, paste the following code in a new program (.prg) file and then save it to the folder you created in step 1. CD JUSTPATH(SYS(16)) CLEAR

IF !FILE(&quot;ReproDBF.DBF&quot;) LOCAL lnCounter AS INTEGER lnCounter = 0 CREATE TABLE &quot;ReproDBF.DBF&quot; ; (F1 C(100) NOT NULL, ;       F2 C(40) NOT NULL, ;        F3 C(5) NOT NULL, ;        F4 C(10) NOT NULL, ;        F5 C(239) NOT NULL, ;        F6 C(4) NOT NULL, ;        F7 C(20) NOT NULL, ;        F8 I NOT NULL, ;        F9 M NOT NULL)

INDEX ON F4 TAG F4

FOR lnCounter = 1 TO 100 INSERT INTO ReproDBF VALUES (          REPLICATE(&quot;x&quot;, 100), ;            REPLICATE(&quot;x&quot;, 40), ;            REPLICATE(&quot;x&quot;, 5), ;            REPLICATE(&quot;x&quot;, 10), ;            REPLICATE(&quot;x&quot;, 239), ;            REPLICATE(&quot;x&quot;, 4), ;            REPLICATE(&quot;x&quot;, 20), ;            lnCounter, &quot;&quot;) ENDFOR GO 50 REPLACE F4 WITH &quot;000&quot; USE IN SELECT(&quot;ReproDBF&quot;) RELEASE lnCounter ENDIF

LOCAL lcDLLCode AS STRING, ; lnCounter AS INTEGER, ; loTstMTDLL AS OBJECT

lcOldSetSafety = SET(&quot;Safety&quot;) lcDLLCode = &quot;&quot; lnCounter = 0 loTstMTDLL = NULL

TEXT TO lcDLLCode NOSHOW DEFINE CLASS SERVER AS SESSION OLEPUBLIC PROCEDURE DoSelect AS INTEGER SET ANSI ON       SELECT * FROM ReproDBF (WHERE F4 LIKE '000%')  INTO CURSOR temp RETURN RECCOUNT(&quot;TEMP&quot;) ENDPROC ENDDEFINE ENDTEXT

CLOSE DATABASES ALL STRTOFILE(lcDLLCode, &quot;DLLMAIN.PRG&quot;) CREATE PROJECT TstMTDLL NOWAIT _VFP.ACTIVEPROJECT.FILES.ADD(&quot;DLLMAIN.PRG&quot;) _VFP.ACTIVEPROJECT.BUILD(&quot;TstMTDLL.dll&quot;, 5) CLEAR

FOR lnCounter = 1 TO 100 loTstMTDLL = NEWOBJECT(&quot;TstMTDLL.SERVER&quot;) ? &quot;Run # &quot; + TRANSFORM(lnCounter) + ; &quot;   DoSelect Results: &quot; + TRANSFORM(loTstMTDLL.DoSelect) RELEASE loTstMTDLL ENDFOR  Run the program. A new .dbf file is created and populated. The code then programmatically builds an MTDLL and calls a procedure which performs a SELECT statement as described earlier. The MTDLL returns an error that resembles the error outlined in the &quot;Symptoms&quot; section.

Additional query words: kbVFP700sp1fix

Keywords: kbbug kbfix kbcodesnippet KB314814

-

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

© Microsoft Corporation. All rights reserved.