First, you do not need the checkstring function. There is a replace function you can use to handle the ' problem. Instead of executing the insert/update use the response.write method to display the sql code. This will allow you to copy/paste the sql statement to manipulate it manually - this will allow to manually find the problem. Are you using sql server ? Is this web page available to the public (or will it be) ?
The SQL queries vary w/different databases. In your case, where-ever the datatype is taken 'text' use the contents within single quotes like 'New Delhi'. The main problem will be with datetime data types as in SQL statements, #is used for MS Access and single quotes ('') are used in MS SQL Server/Oracle.
please use #22/10/2002# for MS Access, and
'22/10/2002' for MS SQL Server/Oracle