realbasic-nug
[Top] [All Lists]

Database Date Field Problems

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Database Date Field Problems
From: Chris Malumphy <cmalumphy at earthlink dot net>
Date: Fri, 28 Jun 2002 22:18:43 -0400
I use RB as a front end to an Informix database at work. I submit an SQL
thru RB, it returns a database cursor and I use the code below to place
the data into a listbox. The code works well, except when one of the
fields I try to retrieve is a Date field. Then the listbox always shows
a result of 00-00-00 rather than a real date. When I look at the data
using any other tool, I get a proper date. Any ideas as to what I'm
doing wrong?

  while not dbcursor.eof
    for n = 1 to nfields
      if n = 1 then
        nrecords = nrecords + 1
        listBoxResults.addrow dbcursor.idxField(n).stringValue
      else
        listBoxResults.cell(listboxResults.lastindex, n-1) =
dbcursor.idxField(n).stringValue
      end
    next
    dbcursor.movenext
  wend



<Prev in Thread] Current Thread [Next in Thread>