Closed coussej closed 6 years ago
Could you please try this patch to go-adodb?
diff --git a/adodb.go b/adodb.go
index 9edfb4a..e5faac0 100644
--- a/adodb.go
+++ b/adodb.go
@@ -528,9 +528,11 @@ func (rc *AdodbRows) Next(dest []driver.Value) error {
}
dest[i] = (*[1 << 30]byte)(unsafe.Pointer(uintptr(sa.Data)))[0:elems]
}
+ if typ.Val != 12 {
+ val.Clear()
+ }
typ.Clear()
sc.Clear()
- val.Clear()
field.Release()
}
rv, err := oleutil.CallMethod(rc.rc, "MoveNext")
This seems to work! I now get an ole.VARIANT with VT_R4 as type, and I can get to the underlying value. Great! š
I had the same issue with VT_BSTR, where they would return as VT_EMPTY, but with your patch this is now also fixed.
My sincere thanks for looking into this (and so quickly!).
Okay, I'll merge this patch above.
Hi, first of all thanks for all the work you've put into making both this and go-ole.
I need to get data out of a custom proprietary time series database for which an OLEDB driver is supplied. I managed to get things up and running for timestamp and integer parameters, but the driver returns certain values as VT_VARIANT to allow mutiple datatype to be returned in the same column.
For example:
Here the value column is of type variant. The resulting object in the interface is of type *ole.VARIANT, but the VT is always empty:
How should I handle this type of column?
Any ideas are much appreciated, spent almost a full day I trying different things š Thanks in advance!!!