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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 call to SQL Stored Proc

Status
Not open for further replies.

jtseltmann

Programmer
Jan 15, 2002
149
US
I have a vb routine that uses a ADODB command to run a sql stroed procedure. This routine has been running fine for a long time now but we have a new wrinkle. They modified the SQL stored proc to have a "Print" statement in the first few lines of the proc and this is causing my VB routine to trip the ErrorHandler code. I get a message box (which is the error handler) and it shows the "Print" statement.

Is this normal? Is the Print statement in the SQL proc causing the return to VB and the error handler code to be executed?

Anyone have any direction for me? Thanks a million!
 
This is the same reason you want SET NOCOUNT ON for your stored proecedures.

Perhaps they will add an optional input paramter that will allow you to suppress this new printed output... like a flag with a default.
 
As a general engineering principle, it is the responsibility by default of the new version to preserve compatibility with the old version, not the other way around. While it may be sometimes the way to go, refitting to accommodate a refit is exponentially more complicated than refitting and accommodating existing clients.

The fact that you are on here attempting a workaround for this modification on code that has been working for a long time is a bit of an indightment of your organization's engineering process in general. If I were the head of your IT department, I would take the position that your SQL mod needed to be backed out and re-engineered to accommodate existing VB code that calls the proc. Furthermore, I would begin analyzing your engineering process in general to understand why situations like this occur, and work to create a process that made it very hard for them to occur in future.

HTH

Bob
 
Bob,
Agreed and it is not an issue...we can back out the updated proc and use the older ones. I was just merely looking for nod that this in fact was causing the issue. The SQL folks don't seem to think this will cause a problem for VB. I don't know sql procs well enough to know. So, again, is that Print statement truly causing the proc to return to the VB Calling routine and hit the Error Handler?

Thanks again all!
 
Without seeing either your VB code or the stored procedure it is impossible to say. But it could very well be.

And in any case, whatever they did has introduced the error, so I wouldn't take the SQL folks opinions to heart.

You might find this thread relates to your topic

 
Joe,
Thanks for the help. I will work with them today to see if the sql quy came up with anything today. I will post snippets from each if we can't resolve it. Thanks for your time and the link...i read the post and learned some good info.
Jeff
 
>whatever they did has introduced the error, so I wouldn't take the SQL folks opinions to heart

Yup.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top