Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cannot update data has apotrophe with ODBC

Status
Not open for further replies.

firehorse24

Programmer
Sep 22, 2006
28
US
Hi Guys,

Hope someone can help me with this issue.

I have an asp script updating dbf with ODBC. The dbf is in AS400. Since in the data contain an apostrophe, Like "INT'L". The objconn.excute(sql) failed with the error message:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)[IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0104 - Token L was not valid. Valid tokens: )

What can I do to make objconn.excute(sql) accept this kind of data? Please help. Appreciate a lot !!!

Thanks !!!



 
Hi Guys,

Sorry, I searched the history of the forums, Got the answer.

Just replace "'" with "''". It works good.


Thank you all !!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top