Create an Active Server Pages (.asp) page named Mtstest.asp that contains the following code:
<HTML><BODY><% lnsecs = Request.QueryString("delay") set ox = Server.CreateObject("myserver.myclass") response.write ox.cnt()%></BODY></HTML>
Place the .asp page in the Wwwroot folder on a Windows 2000 Web server.
On drive C, create a folder called MTSTest.
Start Visual FoxPro.
To create a table to use, run the following code:
CREATE TABLE C:\MTSTest\Counter FREE (count i) INSERT INTO counter VALUES (0) USE
Create a project called MyServer, and add the following code to the main program:
DEFINE CLASS myclass AS form OLEPUBLIC Datasession=2 && private datasession oScriptingContext=0 PROCEDURE Init SET EXCLUSIVE OFF USE C:\MTSTest\Counter shared ENDPROC PROCEDURE xOnStartPage(p1) ENDPROC PROCEDURE MyDoCmd(cCmd) &cCmd && Just execute parameter as if it were a Fox command. ENDPROC FUNCTION MyEval(cExpr) RETURN &cExpr && Evaluate parameter as if it were a Fox expression. ENDFUNC PROCEDURE cnt(p1) LOCAL cStr REPLACE Counter.count WITH Counter.count+1 cStr = _VFP.fullname+"<br>" cStr = cStr + 'thread id = '+TRANS(_VFP.threadid) + "<br>" cStr = cStr + 'Proc id = '+TRANS(_VFP.processid)+ "<br>" cStr = cStr + '<font size=5 color = red>Count = TRANS(Counter.count)+'</font><br>' RETURN cStr ENDPROCENDDEFINE
Build the COM server.
Create a package for the COM server in MTS on the Web server. (For more information, see the "References" section.)
Hit Mtstest.asp with multiple threads using the Microsoft Web Application Stress Tool. (For more information, see the "References" section.)
Look at the Web Application Stress Tool report. Failures may be listed in the report as well as in the Windows Event Log.
For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base: