Cathi
I was trying Example 2: Accessing a Visual FoxPro COM Component
here's what i did
i created a visual foxpro project customer. and in the main program i placed this code.
DEFINE CLASS Customer AS SESSION OLEPUBLIC
FUNCTION Init()
This.Load()
ENDFUNC
FUNCTION Load()
LOCAL lcDatabaseLocation as Character
LOCAL lcTableLocation as Character
IF NOT DBUSED('testdata')
lcDatabaseLocation = _SAMPLES + '\DATA\testdata'
OPEN DATABASE (lcDatabaseLocation) SHARED
ENDIF
lcTableLocation = _SAMPLES + '\DATA\' + This.GetCursorName()
USE (lcTableLocation) NODATA SHARED
ENDFUNC
as a parameter.
FUNCTION Fetch()
LPARAMETERS tcCustID as Character
LOCAL lcAlias
lcAlias = This.GetCursorName()
SELECT (lcAlias)
LOCATE FOR Cust_ID = tcCustID
RETURN FOUND()
ENDFUNC
FUNCTION Destroy()
LOCAL lcCursor as Character
lcCursor = This.GetCursorName()
USE IN (lcCursor)
ENDFUNC
FUNCTION GetCursorName() as String
RETURN "Customer"
ENDFUNC
The customer ID is passed in as a parameter.
FUNCTION GetCreditLimit(tcCustID as Character) as Currency
LOCAL lyCredLimit as Currency
IF This.Fetch(tcCustID)
MaxOrdAmt field in the customer table.
lyCredLimit = EVALUATE(This.GetCursorName() + '.MaxOrdAmt')
ELSE
lyCredLimit = -1
ENDIF
RETURN lyCredLimit
ENDFUNC
ENDDEFINE
I created a mutlithread com dll. Is this Correct ??
Then i added a reference in my webproject to that dll. at this time there was a message
---------------------------
Microsoft Development Environment
---------------------------
Could not find a primary interop assembly for the COM component 'customer Type Library'. A primary interop assembly is not registered for this type library. Would you like to have a wrapper generated for you?
---------------------------
Yes No Help
---------------------------
I said yes. Is this correct ?
then i run the program but this is what i got,sorry its too long .
Server Error in '/WebApplication2' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: File or assembly name System.Web, or one of its dependencies, was not found.
Source Error:
Line 54: -->
Line 55:
Line 56:
Line 57:
Line 58:
Source File: c:\inetpub\wwwroot\WebApplication2\web.config Line: 56
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = System.Web
(Partial)
LOG: Appbase = file:///c:/inetpub/wwwroot/WebApplication2
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: System.Web
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/webapplication2/37f71cbe/939c5907/System.Web.DLL.
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/webapplication2/37f71cbe/939c5907/System.Web/System.Web.DLL.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/WebApplication2/bin/System.Web.DLL.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/WebApplication2/bin/System.Web/System.Web.DLL.
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/webapplication2/37f71cbe/939c5907/System.Web.EXE.
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files/webapplication2/37f71cbe/939c5907/System.Web/System.Web.EXE.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/WebApplication2/bin/System.Web.EXE.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/WebApplication2/bin/System.Web/System.Web.EXE.
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.209; ASP.NET Version:1.0.3705.0