Link to home
Start Free TrialLog in
Avatar of hindersaliva
hindersalivaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

SQL INSERT error - Excel VBA/ADO/Access 2016

I'm getting a strange error.
When I send this INSERT statement from Excel I get an error 'Syntax error in INSERT INTO statement'.

INSERT INTO tblRegularAttendance(ApplicationID, DayNumber, DayName, Session, RoleTitle, Hospital) VALUES('1234567',  4, 'Thursday', '4AM', 'Driver', 'Guys')

Open in new window

But when I run that in the Query Window in Access it runs ok!

The Connection is the same as I use for other ADO INSERT operations on this application.

Any ideas please?
Thanks
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

what error you getting here? make sure you insert the values with same data types?
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial