Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need message box to show SQL Server "Print" statements.

Status
Not open for further replies.

RobRock

Programmer
Oct 17, 2001
6
0
0
US
I have created a simple VB app that runs a stored procedure in SQL Server and works
fine when the procedure doesn't error out. When the proc does error out, I have a
"print" statement in SQL that says the error and why. This is what I want VB to show
me in a message box so I know what the stored procedure has found without going back into SQL. Any suggestions will greatly be appreciated. TIA.
 
You can read the output of any PRINT statements in the ADO connection's error collection.

You could set a return value in your stored procedure that returns, say, -1 if there was some sort of problem. You would then read the contents of the ADO connection's error collection for your PRINT output.

Hope this helps...
smiletiniest.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top