Trying to insert a string using SQL into a DB2 database. Got ODBC err '80040e14'. The string was derived from string1|12345678|string2. I got the number part by using the inStr and the mid functions.
Posted on 2004-10-25
'originalString came from a Check Box
originalString = string1|12345678|string2
FormFind = Instr(1,originalString,"|")
FormFind = FormFind - 1
School = Mid(originalString),1,FormFind)
FormFind = Formfind + 2
BarCode = Mid(originalString),FormFind,8)
FormFind = FormFind + 9
Program1 = Mid(originalString,FormFind)
MySQL = "INSERT INTO FILE1 (PROGRAM_NAME, BAR_CODE, SCHOOL_NAME) values ('"& Program1 &"', '"& BarCode &'", '" & School &"")
Client Access Express ODBC err - Token - was not valid),.
The problem seems to be the bar code. When I Response.Write the SQL the value that is in BarCode is '12345678 '. There is an extra character after the 8. I tried trimming, but that did not work. How do I replace or remove this extra character.