Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Date problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Date problem

 Post Reply Post Reply
Author
jsebastien View Drop Down
Newbie
Newbie


Joined: 25 July 2003
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote jsebastien Quote  Post ReplyReply Direct Link To This Post Topic: Date problem
    Posted: 25 July 2003 at 8:13am
Here is my problem. I have the following code (JSCRIPT).

var date_aujourdhui = new Date();
...
Insertion_Commentaire = oConn.execute("INSERT INTO T_Commentaires (Date_Commentaire, CE_Membre, Commentaire, CE_No_Photo) VALUES (" + date_aujourdhui + "," + num_diplome + ",'" + nouveau_commentaire + "'," + num_photo + ")");
Response.write("Votre commentaire a bel et bien été ajouté." + date_aujourdhui);

The Date_Commentaire field is a date field but I get the following error :

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Fri Jul 25 09:46:52 2003'.

/dev/insertion_commentaire_2.asp, line 24

Can you help me?
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2003 at 4:45am
I don't think many people use JSCRIPT in this forum...
Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2003 at 6:45am

Dates in Access need to be surrounded by ##, so try something like:

.. VALUES (#" + date_today + "#," + ....

(he he - love my French  )

Cheers,
Andrew

There have been many, many posts made throughout the world...
This was one of them.
Back to Top
jsebastien View Drop Down
Newbie
Newbie


Joined: 25 July 2003
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote jsebastien Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2003 at 7:01pm
thanks a lot bunce! I found the answer to my problem on another website but you are 100% right!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.