The VB for application version is 7.1; Teradata version 16.20.53.27.
The SQL statement is very long, the length of it is 59972.I run it into Teradata directly, it works well.
I use the following to execute this SQL in VBA:
set connection = CreateOjbect("ADODB.connection")
connection.open "DSN=xxx UID=XXX PWD=XXX"
Set ObjRecordSet=CreateObject("ADO.RecordSet")
ObjRecordSet.open StrQuery connection
ObjRecordSet.close
connection.close
the error message is
Run-time error '-2147217833 (80040e57)
[Teradata] [ODBC Teradata Driver]Teradata Database
A character string failed conversion to a numeric value
I check the long SQL statement, could not find the convert function for numeric value, only converting string into varchar(80). Thanks!