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

Invalid procedure call - Error number 5 - Issue in QB_Connector 

Invalid procedure call - Error number 5 - Issue in QB_Connector 

Invalid procedure call - Error number 5 - Issue in QB_Connector 

(OP)
I am working with two queries, each of which is calls on a third query for information. Each of the first two queries use SELECT DISTINCT. Lately they have both caused the message Invalid procedure call. (Error number 5.). When I remove the DISTINCT they run. When I put DISTINCT back in they fail and the same message appears.

Each of the first two queries is drawing a calculated text field from the third query. The third query itself draws information from a fourth query and a table in another Access database.

RE: Invalid procedure call - Error number 5 - Issue in QB_Connector 

Can you post SQLs of all queries involved??

combo

RE: Invalid procedure call - Error number 5 - Issue in QB_Connector 

(OP)
Here is the query that seems to be the issue:

SELECT AssemblyToEngineering.CollectionPrefix, AssemblyToEngineering.Base, AssemblyToEngineering.Trim, ItemList_CF.[CF_Item_CF_tem_QRY.CF_Item] AS ProductID, AssemblyToEngineering.EngineeringPrefix, AssemblyToEngineering.EngineeringSuffix, ItemList_CF.Assembly, IIf([CollectionPrefix] Is Not Null,([EngineeringPrefix] & (Right([Assembly],(Len([Assembly])-Len([CollectionPrefix])))) & [EngineeringSuffix]),[Assembly]) AS TrueAssembly, IIf([CollectionPrefix] Is Not Null,([EngineeringPrefix] & (Right([Assembly],(Len([Assembly])-Len([CollectionPrefix]))))),[Assembly]) AS BaseAssembly
FROM ItemList_CF LEFT JOIN AssemblyToEngineering ON (ItemList_CF.AssemblyPrefix = AssemblyToEngineering.CollectionPrefix) AND (ItemList_CF.isBaseNumberOrText = AssemblyToEngineering.Base) AND (ItemList_CF.isAccentNumbeOrTextr = AssemblyToEngineering.Trim)
WHERE ((([ItemList_CF].[CF_Item_CF_tem_QRY.CF_Item]) Is Not Null))
ORDER BY ItemList_CF.[CF_Item_CF_tem_QRY.CF_Item], ItemList_CF.Assembly DESC;

RE: Invalid procedure call - Error number 5 - Issue in QB_Connector 

Test if Right function has proper length in second argunent, i.e no negative values.
You can copy query and replace:
1. ([EngineeringPrefix] & (Right([Assembly],(Len([Assembly])-Len([CollectionPrefix])))) & [EngineeringSuffix]) by (Len([Assembly])-Len([CollectionPrefix]))
2. ([EngineeringPrefix] & (Right([Assembly],(Len([Assembly])-Len([CollectionPrefix]))))) by (Len([Assembly])-Len([CollectionPrefix]))

and separately filter negatives.

combo

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