Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorFill doesn't return an error
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01070830
Message ID:
01070835
Vues:
11
This message has been marked as the solution to the initial question of the thread.
IF NOT CA.CursorFill()
   AERROR(laError)
   MessageBox(laError[1,2])
ENDIF
>Hi everybody,
>
>I'm using Business Object which uses cursor adapter. Here is a code (I create it using Mark McCasland's CursorAdapter builder):
>
>DEFINE CLASS ca_carrier_branches_All AS _cabaselocal
>
>	Comment = "CA subclass for Carrier_branches Table"
>	CursorSchema = "CBRANCH_NAME C(50), cStreet1 C(50), cCity C(35), cState_Code C(2), CCARRIER_BRANCHES_PK C(16)"
>	Alias = "crsCarrier_branches_All"
>	Tables = "Carrier_branches"
>	cbaseselectcmd = "select Carrier_Branches.cBranch_Name, NVL(Address.cStreet1,SPACE(50)) as cStreet1, " + ;
>					  "NVL(Address.cCity, space(35)) as cCity, NVL(Address.cState_Code, SPACE(2)) as cState_Code, " + ;
>					  "Carrier_Branches.cCarrier_Branches_pk FROM Carrier_branches " + ;
>					  "LEFT JOIN Address ON " + ;
>					  "Carrier_Branches.cCarrier_Branches_pk = Address.cPointer_fk"
>	cSelectCmdFilter = "Carrier_Branches.CCARRIERS_FK = ?pcCARRIERS_FK AND Address.iActive_Flag = 1"
>	cselectorderby = "cBranch_Name"
>	cselectotherclauses = ""
>	Name = "ca_carrier_branches_All"
>
>PROCEDURE _ca_autoupdate
>		LOCAL lcFieldList, lcNameList, lcFuncList, lcSchema
>		STORE '' TO lcFieldList, lcNameList, lcFuncList, lcSchema	
>		>		WITH THIS
>			.UpdatableFieldList = lcFieldList
>			.UpdateNameList = lcNameList
>			.ConversionFunc = lcFuncList
>			.KeyFieldList = 'cCarrier_Branches_PK'			
>			._BuildSelectCmd()
>		ENDWITH
>	ENDPROC
>
>ENDDEFINE
>
>
>In run-time when I try to requery BO, the CursorFill method returns .F. However, it doesn't give me any error (may be our class "eats" it). How can I figure out what is wrong here?
>
>The Error method for _caBase class is:
>
>LPARAMETERS tnError, tcMethod, tnLine
>IF m.tnError = 1839 && SQL-Select was cancelled	
>
>	IF VARTYPE(m.plStop) = "L" AND m.plStop
>		* Have we stopped already?
>		IF TYPE("this.parent.parent")= "O" AND PEMSTATUS(this.Parent.Parent,'lRepeatRequery',5)
>			this.parent.parent.lRepeatRequery = .f.
>		endif	
>	ELSE
>		* RETRY  - doesn't work
>		IF TYPE("this.parent.parent")= "O" AND PEMSTATUS(this.Parent.Parent,'lRepeatRequery',5)
>			this.parent.parent.lRepeatRequery = .t.
>		endif	
>	ENDIF
>ELSE
>	DODEFAULT(m.tnError, m.tcMethod, m.tnLine)
>ENDIF
>
>Thanks a lot in advance.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform