Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLE iDispatch Error - What does it mean?
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Title:
OLE iDispatch Error - What does it mean?
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01183748
Message ID:
01183748
Views:
79
Using the example for Rick Strahl's page about Internet Enabling your foxpro application: http://www.west-wind.com/presentations/internetenabling/InternetEnabling.htm

I get the following error:

OLE iDispatch Exception Code 0 from Microsoft ADO/RDS: Internal Server Error... This.Result=Evaluate(lcEvalString)

I created a System DSN in the ODBC administrator named ShawTest. The sql select is valid.. i.e. executes fine in the command window of VFP. rs2dbf.prg is code sample from microsoft.

The code from his site was modified and is 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
What am I forgetting to do?

TIA,
Mike
Next
Reply
Map
View

Click here to load this message in the networking platform