Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Buffering cursors
Message
 
 
À
10/12/2013 12:11:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01589683
Message ID:
01589701
Vues:
47
>>the input form is HTML, so there's no 'direct' entry.
>>There are two update methods being used, one does an update from memvar which only updates the cursor
>>
>>LPARAMETERS tcAlias
>>
>>IF EMPTY( tcAlias )
>>  tcAlias = this.cfetchalias
>>ENDIF
>>
>>LOCAL lnNumFields, lnX, lnSelect, lcField, lcMemVar
>>LOCAL ARRAY laFields[1]
>>
>>lnSelect = SELECT()
>>SELECT (tcAlias)
>>
>>lnNumFields = AFIELDS( laFields )
>>FOR lnX = 1 TO lnNumFields
>>
>>  lcField  = laFields[lnX, 1]
>>  lcMemVar = "m." + lcField
>>* leave the pk alone
>>  IF ALLTRIM(UPPER(lcField)) == ALLTRIM(UPPER(this.cpkfield))
>>	LOOP
>>  ENDIF
>>
>>  IF NOT &lcField == &lcMemVar
>>	REPLACE &lcField WITH &lcMemVar
>>  ENDIF
>>ENDFOR
>>
>>SELECT (lnSelect)
>>
>>
>>
>>The SQL update is called from this chunk of code
>>
>>If CursorGetProp("Buffering")=5
>>  lnRecno = Recno()
>>  lnGetNextModified = Getnextmodified( 0 )
>>  Do While lnGetNextModified # 0
>>    Go lnGetNextModified
>>    lcUpdateStatus = Getfldstate(-1)
>>    If Left( lcUpdateStatus, 1) = "2"
>>      * note the update stored procedure needs to be setup to accept "@delete_tablename = 1" parameter
>>      lcUpdateMessage = "exec " + lcDatabase + "." + This.db_schema + "." + lcPrefix + "_update_" + This.cTableName + " @" + This.cpkfield + ;
>>        "=" + Alltrim(Str(Evaluate(This.cpkfield))) + ", @update_user = '"+ lcUpdateUser + "', @update_program = '" + lcUpdateProgram + "', " ;
>>        + " @delete_" + This.cTableName + " = 1" + ;
>>        IIF(  Type( This.laUpdateTables[lnY] + ".ssnum") # "U", ", @demoid=" +   Alltrim(Str(Int(Val(Eval( This.laUpdateTables[lnY] + ".ssnum"))))), "") + ;
>>        IIF( This.AlwaysSendAcctid And Not Empty( tcAcctId ), ", @acctid='" + tcAcctId + "'", "")
>>
>>      llOk = This.SQLExec( lcUpdateMessage )
>>      If Not llOk
>>        llUpdatesOk = .F.
>>      Endif
>>
>>      lcUpdateMessage = ""
>>
>>*And so forth
>>
>>
>>There's about another page and a half of code like this.
>
>
>If the html values get to the m.lcField variable OK, I don't know

Is any of the columns nullable? Also, I don't like using macros here.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform