ADO is truncating Excel data

前端 未结 2 875
名媛妹妹
名媛妹妹 2021-01-13 12:54

I have a function that gets an ADODB recordset from the contents of a worksheet using ADO, as follows:

Function WorksheetRecordset(workbookPath As String, sh         


        
2条回答
  •  甜味超标
    2021-01-13 13:30

    Unfortuately I had the same problem once before and the reason is that the ACE driver only looks at the first value in a column to decide the data type for that entire column. So, you can try to sort the data with the numeric values on top.

    The "Gold Standard" way to create joined tables in Excel is with vLookup. I would suggest doing this even though it may seem a bit "amateur."

    Also, it appears that setting IMEX to 1 basically forces ACE to return the text representations so that alpha-numeric values in a numeric column are not returned as null.

提交回复
热议问题