[V4RB] VText Problem

Ken Jordan jordan at digi-net.com
Thu Nov 3 09:21:26 CST 2005


Ruslan Zasukhin wrote:

>On 11/2/05 11:57 PM, "Ken Jordan" <jordan at digi-net.com> wrote:
>
>  
>
>>Similar to last (BLOB) problem.
>>----------------------------------------------------
>>  dim f as FolderItem = GetFolderItem( "dbTest.vdb" )
>>  if f.Exists then f.Delete()
>> 
>>  dim testDB as VDatabase = new VDatabase
>>  testDB.Create(f, 1, 32 * 1024, EVOs.kOSDefault )
>> 
>>  dim photo_table as VTable = testDB.CreateTable("ptable")
>>  call photo_table.CreateTextField( "pic", 1024 )
>> 
>>  photo_table.SetBlank()
>> 
>>  f = GetFolderItem("goofy.jpg")
>>  dim p as Picture = f.OpenAsPicture()
>>  dim s1 As String = PNGu.GetData(p)
>>  photo_table.Field( "pic" ).SetString(s1)
>> 
>>  call photo_table.AddRecord()
>> 
>>  dim bRes as Boolean = photo_table.FirstRecord()
>>  dim s2 As String = photo_table.Field( "pic" ).GetString()
>> 
>>  if s1 <> s2 then
>>    msgbox "not the same"
>>  End If
>> 
>>  testDB.Close
>>  testDB = nil
>>----------------------------------------------------------
>>MessageBox displays "not the same" every time.
>>I suspect that its an encoding problem, but I've tried every kind of
>>encoding manipulation that I can think of but haven't been able to get a
>>match. Any ideas??
>>    
>>
>
>Hi Ken,
>
>I do not understand.
>
>You have create TEXT Field, but store into it Picture ?
>This is wrong.
>
>Valentina have Vpicture field type for pictures.
>  
>
Yes, I am aware of the VPicture field type. However, for several reasons 
it would be advantageous if I could store the pictures in string format. 
Is there no way to retrieve the string data in its original form?


More information about the Valentina mailing list