Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
LAPI from Visual Basic - ValueGetDate question
Dan_Duffy
I'm attempting to write some VB wrappers for LAPI and am hitting some snags. Currently this one and one other (posted separately) is bugging me.This one concerns the LL_ValueGetDate call. I'm trying to get the ModifyDate from a row returned by LL_ListObjects. I have been able to successfully retrieve string and integer values from the rows (Name, size, etc), but Date has me stumped.(note: all return values have been allocated with LL_ValueAlloc prior to use--I left that out for simplicity)The following call retrieves a value that LL_ValueGetType identifies as a Date: valName = "ModifyDate" status = LL_ValueGetFieldValue(mrow, valName, val)Now, how do I convert the returned value into a Date type within VB? It will not work as a parameter to Date(val) apparently it is in the wrong dimentsions.I thought that the LL_ValueGetFormatted might at least give me back a string, so I tried this: status = LL_ValueGetFormatted(val, dat) ' ??? Should "dat" now be a handle to a string that can be retrieved ' by ValueGetString? status = LL_ValueGetString(dat, buf, 256, siz)This does not work -- it returns an error (which I cannot manage to interpret--the LL_SessionStatusError does not seem to work for me.Obviously I'm missing some simple thing, but the docs and sample apps do not contain any examples of retrieving dates in VB.Thanks,Jim RossBank of America
Find more posts tagged with
Comments
Dan_Duffy
Thanks to ot tech support I learned that the integer value returned from ValueGetDate is the number of seconds from Jan.1,1970You can convert this to the actual date in VB with the DateAdd function. Something like:myDate = DateAdd("s", LLdateInteger, CDate("1/1/70"))(the "s" above means "seconds")Jim RossBank of America