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!

Arguments are of the wrong type, are... error

Status
Not open for further replies.

Andrzejek

Programmer
Jan 10, 2006
8,509
US
I have this application (in VB6) where - from time to time - I get this error:

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

I can take this SQL and run it in TOAD or any other tool, or even run it in my app, and it works just fine. So why am I getting this error?

Here is the SQL if anyone cares to see:

[pre]
SELECT MYITEM.PSITEM_ITEM_NO,
MYITEM.PSITEM_LONG_DESC1 || ' ' || MYITEM.PSITEM_LONG_DESC2 AS MYITEMDESC,
MYITEM.PSITEM_UNIT_OF_MEASURE,
MYSPEC.PSITEM_SPEC_DESC,
MYITEM.PSITEM_GENERIC_FLAG,
MYITEM.PSITEM_EFFECTIVE_DATE,
MYITEM.PSITEM_EXPIRATION_DATE,
MYITEM.PSITEM_OBSOLETE_ITEM_FLAG
FROM S4240000.V_PSITEM_LIST MYITEM,
S4111000.PSITEM_SPEC_SOURCE MYSPEC
WHERE MYITEM.PSITEM_GENERIC_FLAG = MYSPEC.PSITEM_SPEC_ID (+)
AND (MYITEM.PSITEM_SPEC_YEAR = 84)
AND (MYITEM.PSITEM_OBSOLETE_ITEM_FLAG = 'N')
AND ( (MYITEM.PSITEM_EFFECTIVE_DATE IS NULL AND MYITEM.PSITEM_EXPIRATION_DATE IS NULL)
OR (MYITEM.PSITEM_EFFECTIVE_DATE <= TO_DATE('1/21/2015', 'MM/DD/YYYY')
AND MYITEM.PSITEM_EXPIRATION_DATE IS NULL)
OR (MYITEM.PSITEM_EFFECTIVE_DATE IS NULL
AND MYITEM.PSITEM_EXPIRATION_DATE >= TO_DATE('1/21/2015', 'MM/DD/YYYY'))
OR (MYITEM.PSITEM_EFFECTIVE_DATE <= TO_DATE('1/21/2015', 'MM/DD/YYYY')
AND MYITEM.PSITEM_EXPIRATION_DATE >= TO_DATE('1/21/2015', 'MM/DD/YYYY')))
ORDER BY MYITEM.PSITEM_ITEM_NO
[/pre]

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
that exact query? e.g. all hardcoded values, no variables involved? and how are you executing it on VB6 - OLEDB? and which provider.

as you mention VB6 I am tempted to say you use variables - the following may guide you on the correct path - and reasons can be several and sometimes just due to a subtle error on the user interface that causes some times one of the variables to be populated with incorrect values


Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
No hardcoded values. All dates and PSITEM_SPEC_YEAR are passed variables. I just presented the SQL how Oracle gets it, so no confusion of how it is formatted. To connect to Oracle in VB6 I use: Driver={Microsoft ODBC for Oracle};

I did all this search on Google and I pretty much went thru all the articles about this error. That’s why I decided to ask experts here.

“some times one of the variables to be populated with incorrect values” – well, here is a problem. I keep an error log so if any error happens, I write: when, who, what form etc. along with the SQL that created the error. And this is an actual SELECT statement that was used.



Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
That isn't an Oracle error message, it's a VB error.

What do you do with the values that you get returned by the query? Is it possible that you're reading them into variables that aren't big enough to accommodate all the possible values that they might get sent?

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Thanks ChrisHunt, I will try VB Forum with this question.

The outcome from that query goes to MSHFlexGrid on VB6 Form, so I don't think it is a issue with not enough 'space' in variables/control.

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top