Solved

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

Posted on 2016-11-07
7
30 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
  • 4
  • 3
7 Comments
 
LVL 46

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 46

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

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

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 46

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

930 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now