Re: Inserting into Access
| From: | Miles Thompson | Date: | Wed, 03 Apr 2002 15:57:18 +0000 |
| Subject: | Re: Inserting into Access | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18167@lists.php.net to get a copy of this message | ||
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 or 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, '146.176.13.99', '15:08', 'Counselling') The error is: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT 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 database 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 (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php