The development I am working on is is aimed at UK universities who will
probably have access to Access, but may prefer to use MySQL. For that
reason, I kept the whole thing simple by storing the date as a number
(yyyymmdd). So there shouldn't be any problems with dates.

I think that one solution is to ditch the primary key (not really needed in
this table) and just insert the values into the table without specifying the
recipient fields (it is a log table).


----- Original Message -----
From: "Miles Thompson" <[EMAIL PROTECTED]>
Sent: Wednesday, April 03, 2002 4:57 PM
Subject: Re: [PHP-DB] Inserting into Access

> George,
>  From the Access help file ...
> "You must use English (United States) date formats in SQL statements in
> Visual Basic. However, you can use international date formats in the query
> design grid." Have you tried the date as 04032002 or 04/03/2002? (Neither
> make much sense in association with "number".
> The ODBC driver may treat dates differently, though. Do you have use of a
> Windows machine with Access on it? Does that insert work? Frequently, when
> I'm doing VB work and a query is giving me difficulty, usually an INSERT
> UPDATE I've had to play with it a bit in Access's query designer.
> Do you have a date/time type for this field in the Access table? Might it
> have to be padded?
> This isn't much help, but hopefully it will jar your thinking. <g>
> Miles
> PS Spring is actually arriving here in NS. After a couple of post-equinox
> snow storms, the snow is all gone and I heard real bird song this morning.
> (Something other than chickadees, blue jays, crows and starlings.) And the
> coltsfoot bloomed on the edge of the ditch last Fri. /mt
> At 04:23 PM 4/3/2002 +0100, George Pitcher wrote:
> >Hi all,
> >
> >I'm having a problem inserting some php stuff into an Access table.
> >
> >  This is what is being sent to Access:
> >
> >  INSERT INTO ActivityLog (User, Docid, Date, ClientIP, Time, CourseRef)
> >   VALUES
> >  (6, '15381', 20020403, '', '15:08', 'Counselling')
> >
> >  The error is:
> >
> >  SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in
> >  INTO statement., SQL state 37000
> >
> >  In explanation, User and Date are Number fields and the rest are text
> >  fields.
> >
> >  I am using a similar syntax INSERT INTO another table in the same
> >without a problem. Possibly a cursor problem (I remember some, but not
> >enough, stuff from my brief flirtation with ASP).
> >
> >  Any clues?????
> >
> >  George in Edinburgh
> >
> >
> >
> >--
> >PHP Database Mailing List (
> >To unsubscribe, visit:

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to