Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002

    Exclamation Unanswered: help pleeeeeease!!

    I hope some oneout there can help me. I have been trying to get this code to work for a week and it won't.

    First I have to say that I am new to asp so bear with me.

    I have attached a page that I keep getting two errors on. This page is for editing, adding and deleting records in a database table.

    My errors occur in the UPDATE and INSERT INTO section of the code.

    I believe it has to do with the fact that my fields in the database called Start_Date and End_Date are of Date/Time datatypes.

    The errors I get are as follows:

    For the INSERT INTO section: Syntax error in INSERT INTO statement.

    and for the UPDATE section: Syntax error in UPDATE statement.

    If someone could look at my page and tell me what is wrong, I would really appreciate it.

    I got this code from another guy, so if you have questions that are involved, I don't know if I can answer them.

    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2002
    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) ?

  3. #3
    Join Date
    Oct 2002
    New Delhi, India



    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

    Hope that ur problem will be solved now.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts