[Vserve+V4RB] several cursor.updates in a go

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Dec 9 12:13:46 CST 2004


On 12/9/04 11:31 AM, "Eric Ferrer" <wonderfef at noos.fr> wrote:

Hi Eric,
 
> I have a loop that updates several records.
> This loop crashes the app, with no RB IDE debug error, just a Finder error.
> 
> I tried this is a push button :
> 
>   cursor = theDatabase.SqlSelect("SELECT * FROM myTable WHERE MyField =
> 'Test1'", 2, 1, 1)
>   if cursor.RecordCount = 1 then
>     v = cursor.Field("MyField").GetString + "***test"
>     cursor.Field(" MyField").SetString v
>     if cursor.Update = false then
>       MsgBox "update failed"
>     end if
>   end if

Before create new cursor kill the prev

    cursor = nil

>   cursor = theDatabase.SqlSelect("SELECT * FROM MyTable WHERE Type =
> 'Test2'", 2, 1, 1)
>   if cursor.RecordCount = 1 then
>     v = cursor.Field("MyField").GetString + "***test"
>     cursor.Field("MyField").SetString v
>     if cursor.Update = false then
>       MsgBox "update failed"
>     end if
>   end if
>   
>   cursor = theDatabase.SqlSelect("SELECT * FROM MyTable WHERE Type =
> 'Test3'", 2, 1, 1)
>   if cursor.RecordCount = 1 then
>     v = cursor.Field("MyField").GetString + "***test"
>     cursor.Field("MyField").SetString v
>     if cursor.Update = false then
>       MsgBox "update failed"
>     end if
>   end if
>   
>   theDatabase.Flush
> 
> The app seems to always crash before the third update.
> 
> MyField is type text(256), and for some reasons not explained here, I need
> to retrieve all fields from the table, even if I update only some fields.
> 
> What's wrong ?
> Thank you very much for your help.

-- 
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://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------




More information about the Valentina mailing list