date time

Damon Pillinger daisychain at iinet.net.au
Sat Jun 4 21:59:34 CDT 2005


HI all,

I am using Valentina for Realbasic 2.0

dbase.SQLExecute("Create Table EventLog(damon byte)")
dbase.SQLExecute("Alter Table EventLog ADD LDateTime TimeStamp")
dbase.SQLExecute("Alter Table EventLog ADD Loperator char(50)")
dbase.SQLExecute("Alter Table EventLog ADD Levent char(100)")

This creates the table fine.

When I add a record I use
O is the operator
E is the event

Dim d as date
Dim s as string

D=new date
  
s="'"+format(d.year,"0000")+"-"+format(d.month,"00")+"-"+format(d.day,"0
0")+"
"+format(d.hour,"00")+":"+format(d.minute,"00")+":"+format(d.second,"00"
)+"'"
  s="INSERT INTO EventLog (Loperator,LDateTime,Levent) VALUES
('"+o+"',"+s+",'"+e+"')"
  
  main.dbase.sqlExecute(s)

When I read this using
    r=new recordset
    r=main.dbase.sQLSelect("Select Loperator,Ldatetime,Levent from
EventLog  order BY LDateTime")
    r.movefirst
    listbox1.deleteAllRows
    i=0
    while not r.eof
      listbox1.addrow r.idxField(1).stringValue
      listbox1.cell(i,1)=r.idxField(2).Value   ' also tried .DateValue
and .DateValue.longTime
      listbox1.cell(i,2)=r.idxField(3).stringValue
      i=i+1
      r.movenext
    wend

I have to use something like the above a the datacontrol and dataquery
both return 0000-00-00 00:00:00

What am I missing as the dates that returned are not the correct date or
time and they seem to be the same 4 date/time values at random positions
in the list
Thanks
damon



More information about the Valentina mailing list