Returning values printed by statement

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
iveres
Posts: 10
Joined: Tue 06 Mar 2012 08:00
Location: Croatia, BJ
Contact:

Returning values printed by statement

Post by iveres » Tue 21 May 2013 10:55

How to return messages/values printed by stored procedure?
I using sp_help_revlogin stored procedure at MSSQL 2008r2 that create server logins export script, but using print output.

How to grab this printed output with MSDAC (and save to stringlist or etc...)?

Thanks!

iveres
Posts: 10
Joined: Tue 06 Mar 2012 08:00
Location: Croatia, BJ
Contact:

Re: Returning values printed by statement

Post by iveres » Tue 21 May 2013 13:36

Problem solved!

I created stringlist and new procedore.
Before executing I create stringlist and redirecting OnInfoMessage on connection to my procedure. Procedure putting message to stringlist. Then execute stored procedure and saving stringlist to disk, assigning it to memo... and then destroying stringlist and unasigning OnInfoMessage.

AndreyZ

Re: Returning values printed by statement

Post by AndreyZ » Wed 22 May 2013 06:15

It is correct, PRINT statements can be handled in the TMSConnection.OnInfoMessage event handler.

Post Reply