Menu

Need help with AsVariant

Help
2004-09-21
2013-03-22
  • Josh R Roberts

    Josh R Roberts - 2004-09-21

    AsVariant does not appear to be doing any data type conversions to
    the native data type. To keep our application International
    friendly, we are tranmitting all dates, times and datetimes as
    Floating Point Integers. I made the assumption that AsVariant would
    convert these to the correct values when I inserted them into the
    Palm tables, but it is merely trying to insert the string of the
    Float into the Date field which of course is bombing.

    Any suggestions to make this easy without testing the datatype
    property and converting the Float to a datetime then inserting?

    Thanks
    josh

    BTW, I also posted this on the Yahoo Group.

     
    • Paul Gilbert

      Paul Gilbert - 2004-09-28

      Hey. Sorry I didn't reply to this sooner; it's been a busy week. As you've found, the AsVariant isn't exactly universal; internally, a record is represented as text, with the field definitions telling it how to interpret that text as data to store in the table. AsVariant was originally mainly introduced to allow users to get and set a variant block of binary data.

      I can't offer any suggestion other than manually checking your variant to see if it's a date/time and using the AsDateTime property of the fields.

      Sorry.

      DreamMater.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.