PDA

View Full Version : help pleeeeeease!!


gcapp
10-12-02, 12:09
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.

Thanks,
Gary

rnealejr
10-14-02, 18:13
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) ?

krishan_mahesh
10-22-02, 09:50
Hi,

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.

Thanks