From c85a438f412f32a94f8e872ed7b419b9f7667d6e Mon Sep 17 00:00:00 2001 From: Jean-Pierre Ledure Date: Sun, 27 Mar 2016 16:42:05 +0200 Subject: Access2Base - GetChunk - tests of BLOB field type Change-Id: I02f51ff264c64458c99c47ea48d960a50c65cb75 --- wizards/source/access2base/Field.xba | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'wizards') diff --git a/wizards/source/access2base/Field.xba b/wizards/source/access2base/Field.xba index 7bff09d3e969..5b94ba2f8bee 100644 --- a/wizards/source/access2base/Field.xba +++ b/wizards/source/access2base/Field.xba @@ -189,6 +189,7 @@ Const cstThisSub = "Field.GetChunk" Utils._SetCalledSub(cstThisSub) Dim oValue As Object, bNullable As Boolean, bNull As Boolean, vValue() As Variant +Dim lLength As Long, lOffset As Long, lValue As Long If IsMissing(pvOffset) Or IsMissing(pvBytes) Then Call _TraceArguments() If Not Utils._CheckArgument(pvOffset, 1, _AddNumeric()) Then Goto Exit_Function @@ -205,6 +206,7 @@ Dim oValue As Object, bNullable As Boolean, bNull As Boolean, vValue() As Varian bNullable = ( Column.IsNullable = com.sun.star.sdbc.ColumnValue.NULLABLE ) bNull = False GetChunk = Null + vValue = Array() With com.sun.star.sdbc.DataType Select Case Column.Type ' DOES NOT WORK FOR CHARACTER TYPES ' Case .CHAR, .VARCHAR, .LONGVARCHAR @@ -218,14 +220,15 @@ Dim oValue As Object, bNullable As Boolean, bNull As Boolean, vValue() As Varian Case Else Goto Trace_Error End Select + If bNullable Then bNull = Column.wasNull() + If Not bNull Then + lOffset = CLng(pvOffset) + If lOffset > 0 Then oValue.skipBytes(lOffset) + lValue = oValue.readBytes(vValue, pvBytes) + End If + oValue.closeInput() End With - If bNullable Then bNull = Column.wasNull() - If Not bNull Then - If pvOffset > 0 Then oValue.skipBytes(pvOffset) - oValue.readBytes(vValue, pvBytes) - GetChunk = vValue - End If - oValue.closeInput() + GetChunk = vValue Exit_Function: Utils._ResetCalledSub(cstThisSub) -- cgit