Solved

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

Posted on 2016-11-07
7
48 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

739 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