[V4RB] 3 simple [?] questions
RBtools
RBtools at columbus.rr.com
Wed Feb 26 06:53:07 CST 2003
on 2/26/03 1:02 AM, Pedro fp at lists at pedro.Net.au wrote:
> G'day Folks
>
> Three questions that I suspect are all rather simple matters but I
> haven't found answered in the Valentina docs.
>
> 1. Closing vCursor ... With READdb I found that it is absolutely
> crucial that RecordSets be explicitly closed when finished with. I
> started porting my project planning to follow similar practice with
> Valentina but haven't found any way to explicitly close a vCursor. Is
> it necessary? If so how is it done? With cur = nil?
>
> 2. Dates. I'd like to display dates as a REALbasic ShortDate because
> that formats the date according to the users system preferences.
> Currently I'm doing that with the following ...
>
> d = new date
> d.year = data.DateField( "dateAdded" ).year
> d.month = data.DateField( "dateAdded" ).month
> d.day = data.DateField( "dateAdded" ).day
> efDateAdded.text = d.shortDate
>
> Can anyone suggest a more concise approach?
Depending on how you formatted you date text you could use ParseDate in
RealBasic to set a date parameter. Or what I am currently doing is
mDate = mCursor.Field("mDate").GetString
Mdate in the database is stored as a Date. The will return a formatted
string.
> 3. I have a listbox that will used display at 4 different sets of
> fields. I'd like, if possible, to populate it with a generic block of
> code rather than a block for each set of fields. Am I correct in
> believing that ...
>
> cur.field( indexOrName ).getString
I have a function that populates the names of the headers for the listbox.
I then use those names to extract the data from the table. In my case the
names of the fields in the table match the names in the listbox. I chose
names that could be displayed in a listbox header. If the name in the
database is FirstName then I would put First Name in the table and just
remove the space before it is used to get the data.
Steve
> will return the field contents as a string for all or most field types?
>
> 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
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> "[the digital divide] is just a new sticker we use to cover up a
> more important word: poverty. I don't think we should worry about
> the digital divide nearly as much as we should worry about poverty.
> It's all over the planet."
> Apple co-founder & CEO Steve Jobs, April 2001
>
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
More information about the Valentina
mailing list