[VXCMD] Help with Text fields

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Jun 18 15:49:32 CDT 2005


On 6/18/05 10:27 AM, "Peter McConachie" <pmccon at bigpond.net.au> wrote:

> Can anyone please help,
> 
> I'm having trouble adding a TEXT field to a table under Version1 & MCard
> 2.6.2. Table has 2 string columns (cName,cText) and one TEXT column (cData).
> 
> To add a new record I imagine one first adds a row with
>     put "SELECT cName,cText from Table where recID=0" into sSQL
>     put "valueForcName"&tab&"valueForcText" into addStr
>     put Valentina("DataBase_SQLSelect",dbRef,sSQL,"1","1","1") into cRef
>     put Valentina("Cursor_AddRecord",cRef,addStr,tab) into tRes
>     get Valentina("Cursor_Remove", cRef)
>     get Valentina("DataBase_Flush",dbRef)

No, Peter,

Steps should be as

      put Valentina("DataBase_SQLSelect",dbRef,sSQL,"1","1","1") into cRef

      put Valentina("Cursor_SetBlank",cRef,addStr,tab) into tRes

         // fill fields
         put Valentina("Cursor_GetFieldRef",cRef,"cData") into fRef
         get Valentina("BINARY_WriteData",fRef,"data")

      put Valentina("Cursor_AddRecord",cRef,addStr,tab) into tRes


> Then knowing the recID of the added row I imagine one then updates the TEXT
> column using the following
>     local data
>     put somedata into data
>     put "SELECT * from Table where recID=1" into sSQL
>     put Valentina("DataBase_SQLSelect",dbRef,sSQL,"1","1","1") into cRef
>     put Valentina("Cursor_GetFieldRef",cRef,"cData") into fRef
>     get Valentina("BINARY_WriteData",fRef,"data")
>     get Valentina("Cursor_UpdateRecord",cRef)
>     get Valentina("Cursor_Remove", cRef)
>     get Valentina("DataBase_Flush",dbRef)
> 
> And to read back the added data
>     local data
>     put "SELECT * from Table where recID=1" into sSQL
>     put Valentina("DataBase_SQLSelect",dbRef,sSQL,"1","1","1") into cRef
>     put Valentina("Cursor_GetFieldRef",cRef,"cData") into fRef
>     put Valentina("BLOB_GetDataSize",fRef) into bSize
>     get Valentina("BINARY_ReadData",fRef,"data",bSize,0)
>     get Valentina("Cursor_Remove", cRef)
>     get Valentina("DataBase_Flush",dbRef)

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list