[V4RB] RecID & picture fields

Pedro fp lists at pedro.Net.au
Thu Sep 9 15:01:49 CDT 2004


G'day Folks

Back into Valentina & Rb programming after something of a layoff & 
having 2 problems that are killing the project.

The first is that this line ...

         dRow( i ).itemData = data.uMediumField( "RecID" ).value

in the method that loads the data causes an unexpected quit.
dRow is just a container object that I'm using to hold the retrieved 
data in.
All other setters to dRow, except the one mentioned below, work.
RecID is explicitly included in the field list in my SQL query.

The 2nd problem is that this line ...

         dRow( i ).icon = data.PictureField( "photo" ).getPicture ' Set 
photo icon.

gives a nil object exception with no picture being retrieved.
It could be that I have something wrong in the method that creates the 
record as after importing a folder of 30 images (1.1 MB) the blob file 
of my database hasn't changed in size.
That method, in the baseobject that holds this data, is ...

Sub newPersonFromJPEG( withFile As folderItem )
   dim dataString As string, iDate As new date, i, ln As integer, gt As 
boGlobals

   dataString = left( withFile.name, len( withFile.name ) - 4 )
   writeLog "dataString: " + dataString

   gt = winMain.mDatabase.tGlobals

   ln = gt.lastAdded + 1

   me.setBlank

   me.fLine.value = ln
   me.fDateAdded.set( iDate.year, iDate.month, iDate.day )

   for i = 0 to 1
     me.fName( i ).value = titlecase( nthField( dataString, " ", i + 1 ) 
)
   next

   if countFields( dataString, " " ) > 2 then
     me.fPayNumber.value = nthField( dataString, " ", 3 )
   end if

   me.fPhoto.setPicture( withFile.openAsPicture, 80 )

   me.fLastModified.setDate( iDate.year, iDate.month, iDate.day )
   me.fLastModified.setTime( iDate.hour, iDate.minute, iDate.second )

   me.addRecord

   me.flush

   gt.lastAdded = ln

   writeLog "Imported!"

End Sub

Any clues to either of these?

Cheers, Pedro :-)

Web: <http://www.pedro.net.au>                    PGP Key ID: 387CD96F
Instant messaging...  AIM: bandidoOfOz  ICQ: 27671678  Jabber: pedrofp
                       MSN: mail at pedro.net.au           Yahoo: pedro_fp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"What difference does it make to the dead, the orphans, and the
homeless, whether the mad destruction is brought under the name
of totalitarianism or the holy name of liberty and democracy?"
                                            M K (Mahatma) Gandhi



More information about the Valentina mailing list