DDEPoke to MSAccess

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jun 06, 2006 1:21 pm

Ah, I see the problem! Date is a reserved word in Access. It is a function that returns the date, so I think that is confusing it. Put Date in square brackets instead - square brackets are used to identify a table/recordset column in Access. So change your code to this:

INSERT INTO table_tblMain (Cell, ESN, FailCode, Description, [Date]) VALUES ('Cell2','46605485','Passed','Passed','20060512');

e.g.

Code: Select all

'insert into table_tblMain
SQLString = "INSERT INTO table_tblMain (Cell, ESN, FailCode, Description, [Date]) " & _
"VALUES ('" & cell & "', '" & esn & "', '" & fcode & "', '" & descrip & "', '" & date & "');"
MyDB.Execute(SQLString)
Try that.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

mydave
Junior Coder
Posts: 39
Joined: Fri Jul 22, 2005 12:42 pm

Post by mydave » Wed Jun 07, 2006 1:44 am

Wow! That [Date] did it.
Much appreciated.

Sorry for the late response. I decided to install 8.0.3 then logged off and logged back in as a client. msch would not compile, giving 'cannot compile due to incomplete installation'. I got to log back in as administrator to test.
Thanks again for the great help.
Cheers

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts