I open a TFDConnection
for MS SQL Server with parameters:
DriverID=MSSQL
Password=test
User_Name=test
Server=VS2003-2008
Database=test
Single Co
I would follow help here and avoid calling Prepare before parameters are defined (their data types are fully specified). You haven't missed anything but this note from help:
It is recommended to setup parameters before the Prepare call.
For common ODBC drivers (you are still talking to an ODBC driver, no matter if they internally uses OLE DB to communicate with the DBMS), FireDAC doesn't determine parameter data types for the prepared command. Instead, it prepares command statement on the target DBMS and tries to bind existing ones from the Params collection. That's how the Prepare method is implemented (Tokyo).
ODBC API provides the SQLDescribeParam function to obtain parameter details for the prepared command, but FireDAC doesn't use it anywhere (at this time). Instead, it leaves building parameter collection manually. Which is not wrong, because in the end, it is the developer who needs to know which value to assign to a certain command parameter so as to know this value type.