From 0358cc51f1e7a4decc8082bef50b988afd2b22eb Mon Sep 17 00:00:00 2001 From: Jean-Pierre Ledure Date: Sat, 5 Dec 2015 16:33:21 +0100 Subject: Access2Base - OutputTo binary fields as null fields Do not skip temanymore Change-Id: I6a1276959ab940eb44aedeab2f1c9cc7f71a0e1e --- wizards/source/access2base/Database.xba | 40 +++++++++++++++++---------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'wizards') diff --git a/wizards/source/access2base/Database.xba b/wizards/source/access2base/Database.xba index e28159e43027..dacf29f597d8 100644 --- a/wizards/source/access2base/Database.xba +++ b/wizards/source/access2base/Database.xba @@ -1032,8 +1032,8 @@ Private Function _OutputDataToHTML(poTable As Object, piFile As Integer) As Bool ' Exit when error without execution stop (to avoid file remaining open ...) Dim oTableRS As Object, vData() As Variant, i As Integer, j As Integer -Dim vFieldsSkip() As Variant, iDataType As Integer, iNumRows As Integer, iNumFields As Integer, vDataCell As Variant -Dim vTrClass() As Variant, vTdClass As Variant, iCountRows As Integer, iLastRow As Integer, iFirstCol As Integer, iLastCol As Integer +Dim vFieldsBin() As Variant, iDataType As Integer, iNumRows As Integer, iNumFields As Integer, vDataCell As Variant +Dim vTrClass() As Variant, vTdClass As Variant, iCountRows As Integer, iLastRow As Integer Const cstMaxRows = 200 On Local Error GoTo Error_Function @@ -1041,20 +1041,14 @@ Const cstMaxRows = 200 Print #piFile, " <caption>" & poTable._Name & "</caption>" Set oTableRS = poTable.OpenRecordset( , , dbReadOnly) - vFieldsSkip() = Array() + vFieldsBin() = Array() iNumFields = oTableRS.Fields.Count - ReDim vFieldsSkip(0 To iNumFields - 1) + ReDim vFieldsBin(0 To iNumFields - 1) With com.sun.star.sdbc.DataType - iFirstCol = -1 - iLastCol = -1 For i = 0 To iNumFields - 1 iDataType = oTableRS.Fields(i).DataType - vFieldsSkip(i) = False - If iDataType = .BINARY Or iDataType = .VARBINARY Or iDataType = .LONGVARBINARY Or iDataType = .BLOB Or iDataType = .CLOB Then vFieldsSkip(i) = True - If Not vFieldsSkip(i) Then - If iFirstCol < 0 Then iFirstCol = i - iLastCol = i - End If + vFieldsBin(i) = False + If iDataType = .BINARY Or iDataType = .VARBINARY Or iDataType = .LONGVARBINARY Or iDataType = .BLOB Or iDataType = .CLOB Then vFieldsBin(i) = True Next i End With @@ -1062,9 +1056,7 @@ Const cstMaxRows = 200 Print #piFile, " <thead>" Print #piFile, " <tr>" For i = 0 To iNumFields - 1 - If Not vFieldsSkip(i) Then - Print #piFile, " <th scope=""col"">" & .Fields(i)._Name & "</th>" - End If + Print #piFile, " <th scope=""col"">" & .Fields(i)._Name & "</th>" Next i Print #piFile, " </tr>" Print #piFile, " </thead>" @@ -1088,9 +1080,9 @@ Const cstMaxRows = 200 Print #piFile, " <tr" & _OutputClassToHTML(vTrClass) & ">" For i = 0 To iNumFields - 1 vTdClass() = Array() - If i = iFirstCol Then vTdClass() = _AddArray(vTdClass, "firstcol") - If i = iLastCol Then vTdClass() = _AddArray(vTdClass, "lastcol") - If Not vFieldsSkip(i) Then + If i = 0 Then vTdClass() = _AddArray(vTdClass, "firstcol") + If i = iNumFields - 1 Then vTdClass() = _AddArray(vTdClass, "lastcol") + If Not vFieldsBin(i) Then vDataCell = vData(i, j) Select Case VarType(vDataCell) Case vbEmpty, vbNull @@ -1112,6 +1104,8 @@ Const cstMaxRows = 200 Case Else Print #piFile, " <td" & _OutputClassToHTML(vTdClass) & ">" & _CStr(vDataCell) & "</td>" End Select + Else ' Binary fields + Print #piFile, " <td" & _OutputClassToHTML(vTdClass) & ">" & _OutputBinaryToHTML() & "</td>" End If Next i Print #piFile, " </tr>" @@ -1132,7 +1126,15 @@ Error_Function: TraceError(TRACEWARNING, Err, "_OutputDataToHTML", Erl) _OutputDataToHTML = False Resume Exit_Function -End Function ' _OutputDataToHTML +End Function ' _OutputDataToHTML V1.4.0 + +REM ----------------------------------------------------------------------------------------------------------------------- +Private Function _OutputBinaryToHTML() As String +' Converts Binary value to HTML compatible string + + _OutputBinaryToHTML = "&nbsp;" + +End Function ' _OutputBinaryToHTML V1.4.0 REM ----------------------------------------------------------------------------------------------------------------------- Private Function _OutputDateToHTML(ByVal psDate As Date) As String -- cgit