[V4RB] Bug in UPDATE or ImportText or Flush?

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Mar 24 16:14:49 CST 2003


on 3/23/03 9:51 AM, Richard Altenburg at valentina at brainchild.nl wrote:

> Please help me with this puzzle! Sample code is this:
> 
> 
> 
> vcsImportGroup=New VCursor(ppPiPaBase, "SELECT groupname FROM AvailableGroup
> WHERE RecID=0")
>       
> If (vcsImportGroup<>Nil) Then
>         
>  ppPiPaBase.ppAvailableGroup.Groupname.Indexed=False
>         
>  vcsImportGroup.ImportText(fdiTemp, " ", (Chr(13)+Chr(10)))
>         
>  ppPiPaBase.ppAvailableGroup.Groupname.Indexed=True
>         
>  ppPiPaBase.Flush
>         
>  rowsAffected=ppPiPaBase.SqlExecute("UPDATE AvailableGroup SET
> server_recid="+Format(serverIDInPopUpMenu, "############")+" WHERE
> server_recid=0")
>         
>  ppPiPaBase.Flush
>         
>  vcsImportGroup=Nil

Small advice:
By logic cursor should be destroyed BEFORE SqlExecute()


------------
vcsImportGroup=New VCursor(ppPiPaBase, "SELECT groupname FROM AvailableGroup
WHERE RecID=0")
        
If (vcsImportGroup<>Nil) Then
          
   ppPiPaBase.ppAvailableGroup.Groupname.Indexed=False
          
   vcsImportGroup.ImportText(fdiTemp, " ", (Chr(13)+Chr(10)))

   vcsImportGroup=Nil
        ^^^^^^^^^^^^^^^^ kill cursor right here.
 
>>> Flush() // you have made big operation
         
   ppPiPaBase.ppAvailableGroup.Groupname.Indexed=True
   ppPiPaBase.Flush
          

   rowsAffected=ppPiPaBase.SqlExecute("UPDATE AvailableGroup SET
server_recid="+Format(serverIDInPopUpMenu, "############")+" WHERE
server_recid=0")
          
   ppPiPaBase.Flush
          
-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://listserv.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list