Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2003, 01:52 PM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to costrega Send a message via AIM to costrega
Default Date Field

I am trying write an "SQL insert into" statement and I'm having problems inserting a date value into an Access 2k database.

This is the Insert Into statement that I'm using.

strInsert = "Insert into Notes (Notes, description, Keyword1, Date) Values ('Test Notes','test','keyword1','9/16/03')"

And this is the error I'm receiving.

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/project/updates.asp, line 38


Can anyone help me work out the format problem with the date value?

Thank you,

CO


 
Old September 16th, 2003, 02:38 PM
Authorized User
 
Join Date: Jun 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi CO,

You have 2 error in your query.
1- Rename your field Date for something else, like EnterDate. Date is a reserved word for Jet.
2- You date value must be place between #. Your query should look like this:

strInsert = "Insert into Notes (Notes, description, Keyword1, EnterDate) Values ('Test Notes','test','keyword1',#9/16/03#)"


Stéphane Lajoie
 
Old September 16th, 2003, 02:46 PM
Registered User
 
Join Date: Jun 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to costrega Send a message via AIM to costrega
Default

It works. Thank for the help.

CO





Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating a Date field based on another field arholly Access VBA 6 November 22nd, 2006 11:19 AM
date field keyvanjan Classic ASP Databases 1 May 7th, 2005 02:32 AM
putting a date into a date field elladi Classic ASP Databases 2 March 31st, 2005 01:30 PM
Date Field from Parameter Field narooma.12 Crystal Reports 0 November 14th, 2004 08:51 PM
DTS Import ( Date string to Date field) gfowajuh SQL Server 2000 1 September 30th, 2003 06:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.