Solved

Error when passing an argument to a vb6 that contains  '/'

Posted on 2016-11-07
7
45 Views
Last Modified: 2016-11-09
Noticed an error message that happened in our sql tables scripts but now in our vb6 when passing arguments to the apps:

Run-time error '-2147217900 (80040e14)':
Column name or number of supplied values does not match table definition.

Open in new window


We use a vba to call a vb6 apps:

x = Shell("path\vbapps.exe 125, 1 " & ArgumentVaribale1 & "," & ArgumentTransNo, vbNormalFocus)

Open in new window


The problem occurs when the transaction number has a "/" in it's value, for example "TRANS/NO-090909".

How can we fix this (the table is full of columns with this character)?
0
Comment
Question by:rayluvs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 47

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 41877903
Use Replace to replace all / with // when you send it and change it back when you receive it.
0
 

Author Comment

by:rayluvs
ID: 41877920
Will try, but why does this happens when it's only argument that are passed?

And what if the user decided sets the code to "TR////ANS/NO-09//09///09"?

Is theer another way to pass values when a"/" is presents besides using replace?
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 41877924
If you have the code for the sending program you could validate the "code" and not allow "/".
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:rayluvs
ID: 41877950
Understand that part, but why does this happens when it's only argument that are passed?
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 41877972
I don't know.
0
 

Author Closing Comment

by:rayluvs
ID: 41881222
Would have been great to know the "why" of this problem.

Anyways, thanx!
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 41881255
You're welcome and I'm glad I was able to help.

If you expand the “Full Biography” section of my profile you'll find links to some articles I've written that may interest you.

Marty - Microsoft MVP 2009 to 2016
              Experts Exchange MVE 2015
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2015
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Modern/Metro styled message box and input box that directly can replace MsgBox() and InputBox()in Microsoft Access 2013 and later. Also included is a preconfigured error box to be used in error handling.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question