SQL Server gets error text information, BDE, Adoquery has not been taken, Fdquery can
Some DBMS, like SQL Server, return messages as an additional result set. So, to-process messages, the application needs to process multiple result sets. Here's a more complex example, providing status and messages for SQL Server. As you see, we is using tfdmemtable to store result sets with rows.
var i:Integer;Begin FDConnection1.Resourceoptions.Serveroutput:=True; FDQuery1.FetchOptions.AutoClose:=False; FDQuery1.Open(' SELECT * from region; print '' Hello '‘‘); FDMemTable1.Data:= FDQuery1.Data; Memo1.Lines.Add(Format('%d rows processed ',[FDMemTable1.RecordCount])); FDQuery1.NextRecordsetif fdconnection1. Messages <> nil then for i := 0 to fdconnection1. Messages. Errorcount -1 do memo1. Lines. Add (Fdconnection1. Messages[i]. Message ; End
SQL Server gets error text information