[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 85
  • Last Modified:

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

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
rayluvs
Asked:
rayluvs
  • 4
  • 3
1 Solution
 
Martin LissOlder than dirtCommented:
Use Replace to replace all / with // when you send it and change it back when you receive it.
0
 
rayluvsAuthor Commented:
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
 
Martin LissOlder than dirtCommented:
If you have the code for the sending program you could validate the "code" and not allow "/".
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
rayluvsAuthor Commented:
Understand that part, but why does this happens when it's only argument that are passed?
0
 
Martin LissOlder than dirtCommented:
I don't know.
0
 
rayluvsAuthor Commented:
Would have been great to know the "why" of this problem.

Anyways, thanx!
0
 
Martin LissOlder than dirtCommented:
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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now