|
-
May 11th, 2001, 05:15 AM
#1
SQL syntax error. should be simple...
Code:
INSERT INTO tblDiary ( Year, Month, Day, Time, Event, Venue,
Details)
VALUES('1976','12','03','10pm','strEvent','strVenue','strDetails')
why is this giving a syntax error please?
PS all fields are text fields, field names have been checked. These are not variables, 'cos I wanted to check the SQL...
Ta
-
May 11th, 2001, 05:39 AM
#2
Fanatic Member
Check that the column names are not 'Reserved words' in the database you are using. If they are then use alternative column names or wrap in square brackets as follows:
Code:
INSERT INTO tblDiary ( [Year], [Month], [Day], [Time], Event, Venue, Details) VALUES ('1976','12','03','10pm','strEvent','strVenue','strDetails')
Hope this helps
-
May 11th, 2001, 05:43 AM
#3
Thank you. That was it exactly...Is there a list of reserved words for reference anywhere?
-
May 11th, 2001, 05:51 AM
#4
Tom says thanks too
-
May 11th, 2001, 07:16 AM
#5
Fanatic Member
Access 2000 reserved word list......
-A
ADD
ALL
Alphanumeric
ALTER
AND
ANY
Application
AS
ASC
Assistant
AUTOINCREMENT
Avg
-B
BETWEEN
BINARY
BIT
BOOLEAN
BY
BYTE
-C
CHAR, CHARACTER
COLUMN
CompactDatabase
CONSTRAINT
Container
Count
COUNTER
CREATE
CreateDatabase
CreateField
CreateGroup
CreateIndex
CreateObject
CreateProperty
CreateRelation
CreateTableDef
CreateUser
CreateWorkspace
CURRENCY
CurrentUser
-D
DATABASE
DATE
DATETIME
DELETE
DESC
Description
DISALLOW
DISTINCT
DISTINCTROW
Document
DOUBLE
DROP
-E
Echo
Else
End
Eqv
Error
EXISTS
Exit
-F
FALSE
Field, Fields
FillCache
FLOAT, FLOAT4, FLOAT8
FOREIGN
Form, Forms
FROM
Full
FUNCTION
-G
GENERAL
GetObject
GetOption
GotoPage
GROUP
GROUP BY
GUID
-H
HAVING
-I
Idle
IEEEDOUBLE, IEEESINGLE
If
IGNORE
Imp
IN, In
INDEX
Index, Indexes
INNER
INSERT
InsertText
INT, INTEGER, INTEGER1, INTEGER2, INTEGER4
INTO
IS, Is
-J
JOIN
-K
KEY
-L
LEFT
Level
Like
LOGICAL, LOGICAL1
LONG, LONGBINARY, LONGTEXT
-M
Macro
Match
Max, Min, Mod
MEMO
Module
MONEY
Move
-N
NAME
NewPassword
NO
Not
NULL
NUMBER, NUMERIC
-O
Object
OLEOBJECT
OFF
ON
OpenRecordset
OPTION
OR, Or
ORDER
Outer
OWNERACCESS
-P
Parameter
PARAMETERS
Partial
PERCENT
PIVOT
PRIMARY
PROCEDURE
Property
-Q
Queries
Query
Quit
-R
REAL
Recalc
Recordset
REFERENCES
Refresh
RefreshLink
RegisterDatabase
Relation
Repaint
RepairDatabase
Report
Reports
Requery
RIGHT
-S
SCREEN
SECTION
SELECT)
SET
SetFocus
SetOption
SHORT
SINGLE
SMALLINT
SOME
SQL
StDev, StDevP
STRING
Sum
-T
TABLE
TableDef, TableDefs
TableID
TEXT
TIME, TIMESTAMP
TOP
TRANSFORM
TRUE
Type
-U
UNION
UNIQUE
UPDATE
-V
VALUE
VALUES
Var, VarP
VARBINARY, VARCHAR
-W
WHERE
WITH
Workspace
-X
Xor
-Y
Year
YES
YESNO
The following symbols should not be used as part of a field name:
.
/
*
:
!
#
&
-
?
-
May 11th, 2001, 08:33 AM
#6
phew! cheers pal.
Hope you have a good weekend...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|