I have a SQL server backend and am using MS Access as the front end DB.
I'm trying to run a INSERT INTO statement from the Visual Basic editor. However, it says I have a syntax error in my statement. I've looked this over dozens of times and this just puzzles me. As far as I can see, the syntax is right. Maybe someone can make some sense out of this.
the field types are: datetime - datetime, productid - int, lineid - int
here's the assignment statement:
sql = "insert into dbo_Schedule (datetime, productid, lineid) values ('2/1/2005', '99', '1')"
docmd.runsql sql
and this is the error I get:
-2147217900 Syntax error in INSERT INTO statement.
However, when I remove the datetime field from the insert into statement, it executes successfully adding the new records with the desired values inserted into productid and lineid fields.
I even tried changing the datetime field to type varchar and was trying to store a simple string in there. That too gave the same error above.
Any help will be much appreciated.
Thanks in advance
Angelo