首页 > 代码库 > SQL SERVER获取错误文本信息
SQL SERVER获取错误文本信息
SQL SERVER获取错误文本信息,BDE、adoquery一直取不到,FDQuery可以了
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 is a more complex example, providing status and messages for SQL Server. As you see, we are 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.NextRecordSet; if FDConnection1.Messages <> nil then for i := 0 to FDConnection1.Messages.ErrorCount - 1 do Memo1.Lines.Add(FDConnection1.Messages[i].Message);end;
SQL SERVER获取错误文本信息
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。