INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

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

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

(OP)
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:

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
 

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.

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

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

https://www.google.com/search?q=Arguments+are+of+t...

Regards

Frederico Fonseca
SysSoft Integrated Ltd
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

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

(OP)
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.

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

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

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

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close