This topic is locked
[SOLVED]

 DB2 - Type mismatch: 'addslashes'

8/6/2014 9:12:54 AM
ASPRunnerPro General questions
acaruson author

I'm trying to create the most simple of apps. It connects to a DB2 table...which I have done successfully.
The table has a few thousand records and I simply want to allow the user to view a LIST and have an option to view a more detailed VIEW form (containing a bit more data than what I'm displaying on the LIST form.)
Absolutely nothing fancy here at all.
I've successfully been able to create the LIST form, and it displays and sorts the data with no issues.
However, when the user selects the "magnifying glass" icon to VIEW a record...and thus call the associated VIEW form, I receive the following error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'addslashes'
/UDBDB2_SNCOMM/include/dbfunctions.asp, line 11[/indent][/font][/b]
Even if I reduce the fields on the VIEW form to ONLY one field....containing only a small amount of text (person's name)...I still get this error. I also get this error when trying to generate results from an ADVANCED SEARCH. The SEARCH form loads...however, I receive the same error when trying to run a search query.
[size="3"]Has anyone ever seen this error before? Have any thoughts as to why it's occurring?
Thank you in advance for any help or expertise.
[/size]

mperry622 8/6/2014

I would check your db or columns for addslash... I only get that error if i am using a filed not in the database or not mapped right.try to blank out db and start with an empty DB to debugg...

acaruson author 8/7/2014



I would check your db or columns for addslash... I only get that error if i am using a filed not in the database or not mapped right.try to blank out db and start with an empty DB to debugg...


I only get this error when I perform a search on a field containing "text"...not a field containing a number or integer. I'm getting a strong feeling it's related to the way the SQL statement is being generated and used against the DB2 table.
In the dbfunctions.asp file, the line in question is shown in red below:
[indent]Function db_addslashes(ByVal str)

doAssignmentByRef db_addslashes,addslashes(str)

Exit Function

End Function[/indent]
I can't seem to find a function anywhere called "addslashes". I can find "db_addslashes" though.
Essentially, I can't run a search on any field that holds "text"...only numbers.

acaruson author 8/8/2014

[size="3"]PROBLEM SOLVED! (So far...)[/size]
I seem to have fixed the issue. So far so good.
I've altered the following PROGRAM file:
Which is used to create [font="Courier New"]when the application is built.
Line 11 contains the following:
[b][indent][font="Courier New"]doAssignmentByRef db_addslashes,addslashes(str)[/indent]

For some reason (not sure why), the "**" portion causes an error (adding slashes) when searching strings with text...but not strings with just numbers or integers.
My solution has been to alter the following file...I REM line 11 and replace it with what's shown below:
[font="Courier New"]
C:\Program Files\ASPRunnerPro8.1\source\include\dbfunctions.db2.asp
[indent][indent]
[color="#FF0000"]'doAssignmentByRef db_addslashes,addslashes(str)


[color="#9932CC"][b][size="4"]Problem solved! Now search strings containing text don't receive an error when working with DB2. I hope this helps someone else who may get this error when working with DB2 data someday.[/size]**

G
gonzalosb 8/8/2014

acaruson,

thank you for take the time and post the solution with details.

everyone with this problem can relay on this post from now on and may help ASPR teams on futures updates and research.