Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying again - what wrong with this?
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01183944
Message ID:
01184029
Views:
10
I don't see "Result" defined in the class.

good luck


>From Rick Strahl's website - white paper - Internet Enabling Foxpro Applications
>http://www.west-wind.com/presentations/internetenabling/InternetEnabling.htm
>
>I modified some of the code as below
>lcConnStr = "dsn=ShawTest"
>lcSQL = "select company,address1,address2,city from arcust"
>oRDS = CREATEOBJECT("RDS.DataControl")
>oRDS.SERVER = "http://Localhost/"
>oRDS.CONNECT = lcConnStr
>oRDS.FetchOptions = 1     && adcFetchUpFront
>oRDS.ExecuteOptions = 1   && adcExecSync
>oRDS.SQL = lcSQL
>*** Wrap Execute command into 'safe exec' object
>*** so we can trap any errors
>oEval = CREATEOBJECT ("wwEval")
>lnResult = oEval.Evaluate( "oRDS.Refresh()")
>
>IF oEval.lError
>   ? oEval.cErrorMessage
>   RETURN .NULL.
>ENDIF
>*** Convert the RecordSet into a DBF file
>rs2DBF(oRDS.recordset,"TQuery")
>BROWSE
>RETURN oRDS
>
>DEFINE CLASS wwEval as CUSTOM
>lError = .F.
>nError = 0
>nErrorLine=0
>cErrorMessage = ""
>vErrorResult = ""
>
>FUNCTION Evaluate
>LPARAMETERS lcEvalString
>THIS.lError=.F.
>THIS.Result = EVALUATE(lcEvalString)
>IF THIS.lError
>  THIS.lError = .T.
>  THIS.cErrorMessage=Message()+ " - " + Message(1)
>  RETURN THIS.vErrorResult
>ENDIF
>RETURN THIS.Result
>ENDFUNC
>
>FUNCTION ExecuteCommand
>LPARAMETERS lcEvalString
>THIS.lError = .F.
>&lcEvalString
>IF THIS.lError
>  THIS.lError = .T.
>  THIS.cErrorMessage = Message()+ CR + "Code: " + lcEvalString
>  RETURN THIS.vErrorResult
>ENDIF
>ENDFUNC
>
>FUNCTION ERROR
>LPARAMETER nError, cMethod, nLine
>THIS.lError = .T.
>THIS.nError = nError
>THIS.nErrorLine = nLine
>THIS.cErrorMessage = MESSAGE()
>ENDFUNC
>ENDDEFINE
>
>The error I get is:
>
>OLE IDispatch exception code 0 from Microsoft ADO/RDS: Internal Server Error... - This.Result=EVALUATE(lcEvalString)
>
>What have I forgotten to do?
>
>TIA,
>Mike
Previous
Reply
Map
View

Click here to load this message in the networking platform