[V4RB] Table working with 1.9.7 but not with 1.9.8

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Sep 13 12:55:06 CDT 2003


on 9/13/03 12:50 PM, Stan Busk at maxprog at mac.com wrote:

> Hi,
> 
> Thanks Ruslan for your response.
> 
>> Am I right that you use here BaseObject API in the mix with Cursor API?
>> I have warn that this is bad idea.
> 
> Yes, I make this all the time with no problems until yesterday with
> 1.9.8
> I read many times it is better to modify the cursor records. It that
> true? Problem is I don't know how to do this. If you can give me an
> example with my sample code I would appreciate it a lot and I will
> learn with it so I can make all other modifications myself. How should
> I modify this code to use Cursor API only?
> 
> Sub Prefs_SetValue(inDatabase As DB_Data, inKey As String, inValue As
> String)
>  Dim aCursor as VCursor
>  Dim aResult As String
>  Dim aErr As Boolean
> 
>  aCursor = nil
>  aCursor = inDatabase.SQLselect("Select * from Preferences where
> PrefEntry_Name='"+inKey+"'")
>  if aCursor<>nil then
>     if aCursor.RecordCount>0 then
>        
> inDatabase.mPrefs.Update(aCursor.ULongField("PrefEntry_Record").Value,
> inValue)
>     else
>        inDatabase.mPrefs.Add(inKey, inValue)
>     end if
>  end if
> End Sub
> 
>> As I see you try inDatabase.mPrefs.Update()
>> But in the same time you have made cursor (Select * from Preferences )
>> On this table. And cursor have set READ LOCKS on its records.
> 
> So how can I modify cursor directly if they are locked?
> 
>> You can try resolve problem if kill cursor before
>> inDatabase.mPrefs.Update()
>> Todo this at first extract your long value into tmp variable,
>> Then kill cursor then do inDatabase.mPrefs.Update()
> 
> I can try to do this is this particular function but the problem is I
> use such approach everywhere so it means I am going to run in troubles
> in many places. I would prefer to do it the right way since the
> beginning.

Okay, then you need in your SQLSelect()
    specify 3 new parameters as

        kV_Server, kV_NoLocks, kV_Random

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