Why does this crash?

Ruslan Zasukhin sunshine at public.kherson.ua
Sun Jul 6 22:55:06 CDT 2003


on 7/6/03 20:20, jda at jda at his.com wrote:

Hi Jon,

> I'm doing a query where I create and then destroy a sortmethod
> on-the-fly. It worked before, but now crashes (V4RB, b11, OS X):
> 
>      s = s + " ORDER BY authorEditorSortMethod,date" //create the query
> 
>      fld = 
> myDatabase.myReferences.createField("authorEditorSortMethod",
> kv_TypeVarChar, 504, "English", "if
>               (length(authors)=0, if
> (length(editors)=0,title,editors),authors)") //create a method in
> case a field is
>                empty
> 
> 
>    myCursor = myDatabase.SQLSelect(s, kServer, kReadOnly) //OK
> 
>    if fld<> nil then
>      myDatabase.myReferences.deleteField(fld) //destroy the
> temporary method -- crashes!
>    end if
> 
> Obviously (?) Valentina has locked the new method. But why? Once the
> SQL query is done does the cursor have to know about the method used
> to sort the results?

I think it crashes because you try delete field (BaseObject method) from
table, while you still have cursor that use that field.

I think it is obviously wrong idea.
You need at first destroy cursor

    myCursor = nil 


-- 
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