By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,558 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,558 IT Pros & Developers. It's quick & easy.

VB6 ADO and OUT PARAMETERS

P: n/a
All my SPs have an SQLSTATE OUT parameter. However, working with MS
VB6 ADO, parameters IN have no problem, but SQLSTATE parameter OUT (in
the procedure) always returns empty. Reviewing the COMMAND object
shows that it does have an P_SQLSTATE parameter, (that's what it's
called in the stored procedure), but it is always empty.

I have tried (in the app) to define a parameter to be passed to
receive the SQLSTATE, but that is worse -- it adds an extra parameter
where not needed.

I cannot find a way to receive that parameter.

Others?

Sep 8 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
28******@gmail.com wrote:
All my SPs have an SQLSTATE OUT parameter. However, working with MS
VB6 ADO, parameters IN have no problem, but SQLSTATE parameter OUT (in
the procedure) always returns empty. Reviewing the COMMAND object
shows that it does have an P_SQLSTATE parameter, (that's what it's
called in the stored procedure), but it is always empty.

I have tried (in the app) to define a parameter to be passed to
receive the SQLSTATE, but that is worse -- it adds an extra parameter
where not needed.
I think there is a conceptual mis understanding here.
You shoudl not need a SQLSTATE OUR parameter.
At beats you have SQLSTATE local variable for soem handlers.
The SQLSTATE is set by either a SIGNAL, RESIGNAL statement or an error.
The value is passed back by DB2 through the SQLCA structure along with
the SQLCODE.

How do you check teh SQLSTATE in VB6 for normal SQL statements (like
UPDATE). Should be the same for CALL.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Sep 9 '07 #2

P: n/a
On Sep 9, 10:19 am, Serge Rielau <srie...@ca.ibm.comwrote:
2803s...@gmail.com wrote:
All my SPs have an SQLSTATE OUT parameter. However, working with MS
VB6 ADO, parameters IN have no problem, but SQLSTATE parameter OUT (in
the procedure) always returns empty. Reviewing the COMMAND object
shows that it does have an P_SQLSTATE parameter, (that's what it's
called in the stored procedure), but it is always empty.
I have tried (in the app) to define a parameter to be passed to
receive the SQLSTATE, but that is worse -- it adds an extra parameter
where not needed.

I think there is a conceptual mis understanding here.
You shoudl not need a SQLSTATE OUR parameter.
At beats you have SQLSTATE local variable for soem handlers.
The SQLSTATE is set by either a SIGNAL, RESIGNAL statement or an error.
The value is passed back by DB2 through the SQLCA structure along with
the SQLCODE.

How do you check teh SQLSTATE in VB6 for normal SQL statements (like
UPDATE). Should be the same for CALL.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
_______________________
Serge,

You said:

<<The value is passed back by DB2 through the SQLCA structure along
with
the SQLCODE. How do you check the SQLSTATE in VB6 for normal SQL
statements (like
UPDATE). Should be the same for CALL.>>

I remember that from my C days. But how does one create and receive
the SQLCA struct in VisalBasic6 from a DB2 database? If there is one
thing on which I would bet my fortune, it would be that Microsoft
ain't gonna tell you, and that they will go out of their way to
obfuscate and make it impossible.

I see that there are examples in the docs. But they are all, every
single one of them, in C++. They all need "includes." I can work
with APIs if necessary.

But there has to be an easier way -- surely ?!?

<<Should be the same for CALL.>you said. What did you mean?

Am I the only one who, after all these years, actually wants to check
SQLSTATE returns?

SS

Sep 9 '07 #3

P: n/a
On Sep 9, 10:19 am, Serge Rielau <srie...@ca.ibm.comwrote:
2803s...@gmail.com wrote:
All my SPs have an SQLSTATE OUT parameter. However, working with MS
VB6 ADO, parameters IN have no problem, but SQLSTATE parameter OUT (in
the procedure) always returns empty. Reviewing the COMMAND object
shows that it does have an P_SQLSTATE parameter, (that's what it's
called in the stored procedure), but it is always empty.
I have tried (in the app) to define a parameter to be passed to
receive the SQLSTATE, but that is worse -- it adds an extra parameter
where not needed.

I think there is a conceptual mis understanding here.
You shoudl not need a SQLSTATE OUR parameter.
At beats you have SQLSTATE local variable for soem handlers.
The SQLSTATE is set by either a SIGNAL, RESIGNAL statement or an error.
The value is passed back by DB2 through the SQLCA structure along with
the SQLCODE.

How do you check teh SQLSTATE in VB6 for normal SQL statements (like
UPDATE). Should be the same for CALL.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
I guess i must re-post this one

SS

Sep 11 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.