Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trying again - what wrong with this?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
Trying again - what wrong with this?
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01183944
Message ID:
01183944
Vues:
59
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform