I have vba code to fetch Oracle tables data in to a recordset via ODBC. But it shows some unspecified error if the oracle table is having timestamp field in it.
I have 100+ table i dont know which table will have timestamp. I am running below query in loop to retrieve data.
Query = "Select End_Time from MyTable" 'this table has End_Time timestamp(6) field
CmdSQLData.CommandText = Query
CmdSQLData.CommandType = adcmdText
CmdSQLData.Timeout=0 set rs = CmdSQLData.Execute() 'This line shows unspecified error then the table is having timestamp field
'Then code for store data here...
RunTime Error '-2147467259 (80004005)'; Unspecified error
Oracle Table structure is :
create table MyTable (
Date_id Integer,
Date_Today Date,
End_Time Timestamp(6)
)
Please do not suggest some thing like,
select to_char(timestamp_field) from my_table
If i do above query, then the problem is not coming. I need permanent code to handle Timestamps in Recordsets because i may not know whether the table is having timestamp field or not as i have 100+ tables