URLlist.Cell(URLlist.LastIndex, 1) = rs.Field(“url”).StringValue URLlist.Cell(URLlist.LastIndex, 0) = Cstr(rs.Field(“ID”).IntegerValue) Rs = db.SQLSelect(“SELECT * FROM URLdata”) //Get all of the data from URLdataĭo until rs.EOF //continue until we reach the End Of File The changedate field is defined as DateTime in the database.
#Xojo cstr code#
I converted my code to the example showing me to use string Value for the date but am still getiing a nilObject exception. for several months obviously! Recently I have decided to try and become one with XOJO again.
after much frustration just trying to display a date I finally gave up. You can get a nilobjectexception on that oneįirst of all, a belated thank you all for your responses. URLlist.Cell(URLlist.LastIndex, 3) = rs.Field("datechange").StringValueĪLL this said what does your query look like that grabs the recordset ?ĭid you ask for all the columns you try to access ? URLlist.Cell(URLlist.LastIndex, 2) = rs.Field("comments").StringValue URLlist.Cell(URLlist.LastIndex, 1) = rs.Field("url").stringvalue URLlist.Cell(URLlist.LastIndex, 0) = CStr(rs.Field("ID").IntegerValue) While rs.EOF true //continue until we reach the End Of File If rs Nil Then //Continue if there is data Sqlite really doesn’t give a darn about what column type you stuck on a columnīasically everything is stored as strings but there are affinities so some column types will be treated like numbers (but still can be dealt with as strings) … It’s very loose if you’re used to a different sql databaseĭb.sqlexecute("create table urls( id, url, comments, datechange)")ĭb.sqlexecute("insert into urls( id, url, comments, datechange) values (1, """", ""comment"", """ + now.SQLDateTime + """ ) " )ĭim rs As recordset = db.sqlselect("select * from urls") You DO use a form that does not assume you have at least 1 row 1) do until ASSUMES you have at least 1 row which may not be true depending on the queryĮither use do until rs.eof so you check at the TOP of the loop or while rs.eof true that also checks at the top of the loop