473,396 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

VB6 ADO and OUT PARAMETERS

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
3 3688
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
2
by: Mark | last post by:
I created a test to check the execution time difference between executing a SQL Server stored procedured using explicit parameters versus not. In one case I created new SqlParameters in the code,...
4
by: Tim::.. | last post by:
Can someone tell me a better way or give me a link that shows a better way to create large numbers of SQL parameters... Example... A better way to write this code! <code> Sub...
14
by: cody | last post by:
I got a similar idea a couple of months ago, but now this one will require no change to the clr, is relatively easy to implement and would be a great addition to C# 3.0 :) so here we go.. To...
18
by: John Friedland | last post by:
My problem: I need to call (from C code) an arbitrary C library function, but I don't know until runtime what the function name is, how many parameters are required, and what the parameters are. I...
2
by: Hexman | last post by:
Hello All, Well I'm stumped once more. Need some help. Writing a simple select and update program using VB.Net 2005 and an Access DB. I'm using parameters in my update statement and when trying...
12
by: pamelafluente | last post by:
Hi guys, In the past I have used several time optional parameters in my function. But Now I am more inclined to think that they are more dangerous than useful, and probably better to be...
1
by: John Kotuby | last post by:
Hi all, I am working on porting an application from VB6 to VB.NET 2003 and am running into some problems. When declaring and populating the parameters for a SQL Stored Procedure by using the...
0
by: Xah Lee | last post by:
In this article, i explain how the use of bit masks is a hack in many imperative languages. Often, a function will need to take many True/False parameters. For example, suppose i have a function...
2
by: Jared Grant | last post by:
I am trying to find the value from some output parameters from a stored procedure. I have tried several different methods but somehow cannot get it to work. here is my source code: dim dr as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.