If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > help pleeeeeease!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-12-02, 11:09
gcapp gcapp is offline
Registered User
 
Join Date: Oct 2002
Posts: 1
Exclamation 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.

Thanks,
Gary
Attached Files
File Type: zip help.zip (3.2 KB, 50 views)
Reply With Quote
  #2 (permalink)  
Old 10-14-02, 17:13
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
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) ?
Reply With Quote
  #3 (permalink)  
Old 10-22-02, 08:50
krishan_mahesh krishan_mahesh is offline
Registered User
 
Join Date: Oct 2002
Location: New Delhi, India
Posts: 2
Arrow

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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On