I have written some code to connect to Oracle using ADO 2.6.
Consider: varTemp = rs.Fields(1).value
If Oracle datatype is Date, Number or Varchar2, the following snipit works fine.
cells(1,1).value = varTemp.
However if Oracle datatype is Number(n) (i.e. Number(5)) the snippit cells(1,1).value = varTemp produces a 1004 runtime error.
Further inspection using Typename(varTemp) shows that the VBA datatype is Decimal. Therefore I tried: Cells(1,1).value = Cdec(SomeNumber) and sure enough a 1004 runtime error occurs.
I fixed the code with If typename(varTemp) = “Decimal” then varTemp = cDbl(varTemp).
Can anyone enlighten me on the Decimal data type. Excel obviously does not handle it. Excel 97 also does not play well with others. I will try this on Excel 2000 later.
Thanks