Get timestamp field value with adodb - how to read byte array from classic asp

I am working with asp and adodb querying the database (ms sql 2005)

I have a field named stamp, type timestamp

in asp i get the following

field.ctualSize: 8 field.DefinedSize: field.Name: Stamp field.Type: adBinary (128)

field.Attributes: 528 (adFldFixed (16) + adFldRowVersion (512)) (so adFldLong is not included, so I cannot use the getchunk method!) http://msdn.microsoft.com/en-us/library/ms676678(VS .85) .aspx

In the debugger, if I type field.value I get the following

? field.value
{...}
    (0): 0
    (ten
    (20
    (thirty
    (4): 0
    (5): 35
    (6): 163
    (7): 124

That's what I want to GET !!!! but i don't know how to do it ...

I can assign it to a variable, but I cannot get every item

I tried with

? cstr (field.value)
""
? field.value (0)
Número de argumentos erróneo o asignación de propiedad no válida: 'field.value'

(wrong number of arguments)

? vartype (field.value)
8209 (8192-vbArray + 17-vbByte)

So the problem is that I have a byte array, well how do I read it ???

0


a source to share


1 answer


well i found it ...

http://www.ureader.com/msg/16755039.aspx

I had to use

h = hex (ascb (midb (barray, c, 1)))



to convert it to hex ...

so i did something like this

    s = ""

    for c = lbound (barray) + 1 to ubound (barray) + 1
        h = hex (ascb (midb (barray, c, 1)))
        h = padl (h, 2, "0")
        s = s & h & ""
    next
0


a source







All Articles