[V4RB] Table working with 1.9.7 but not with 1.9.8

Stan Busk maxprog at mac.com
Sat Sep 13 19:11:26 CDT 2003


Hi,

Thanks Charles and Ruslan for the code, I have now 3 different ways of  
doing this.

Stan

>
> On Saturday, September 13, 2003, at 05:50 AM, Stan Busk 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
>
> Here you go.
>
> Charles Yeomans
>
> -------------------------
>
> dim c as VCursor
>
> c = = inDatabase.SQLselect("Select PrefEntry_Name, PrefEntry_Record   
> from Preferences where PrefEntry_Name='"+inKey+"'")
> If c <> nil then
>   c.Field("PrefEntry_Name").SetString inKey
>   c.Field("PrefEntry_Record").setString inValue
>   If c.RecordCount = 0 then
>     If c.Add then
>       inDatabase.mPrefs.Flush
>     Else
>       //handle error
>      End if
>   Else
>     If c.Update then
>       inDatabase.mPrefs.Flush
>     Else
>        //handle error
>     End if
>   End if
> Else
>   //handle error
> End if
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>
>

MAX Programming LLC - http://maxprog.com - Investigation & development
----------------------------------------------------------------------
     Store | <http://store.maxprog.com/>    mailto:orders at maxprog.com
  Products | <http://products.maxprog.com/> mailto:info at maxprog.com
  Download | <http://download.maxprog.com/> mailto:info at maxprog.com
   Support | <http://support.maxprog.com/>  mailto:support at maxprog.com


_______________________ CONFIDENTIALITY NOTICE _______________________
The information transmitted in this email and any attached document(s)
is confidential and intended solely  for the use  of the individual or
entity to which  it is addressed and may  contain privileged material.
Any review, retransmission, dissemination or other  use  of, or taking
of any action in reliance upon this information by persons or entities
other than the intended recipient is  prohibited. If you received this
in error, please contact the  sender and delete the  material from any
computer. Copyright 1999-2003 MAX Programing LLC - All rights reserved




More information about the Valentina mailing list