What is wrong with my SQL INSERT syntax?

Owen Ransen 541 Reputation points

Here is my SQL INSERT statement

sSqlInsert = "Insert into GruppoColl Values (12343009,TRUE,'30/06/2022 11:57:35',RD,Descrizione,TRONCHETTI_RAME_12.IPT,20050082,'Tipo B','Bombato',0,oransen,'In')"  

Here is the error message:

  Message=No value given for one or more required parameters.  

I know 'In' is a reserved word and that 'Tipo B' has spaces so I've put them in single quotes.

Here is the definition of the table in Access:


I've clearly missed something, but what?

Access Development
Access Development
Access: A family of Microsoft relational database management systems designed for ease of use.Development: The process of researching, productizing, and refining new or existing technologies.
797 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 38,786 Reputation points

    That isn't MS SQL Server, it's MS Access, right?

    Values (12343009,TRUE,'30/06/2022 11:57:35',RD,Descrizione,TRONCHETTI_RAME_12.IPT,20050082

    What's "Descrizione" and the others; it's not a fix string literal?

    0 comments No comments

  2. Gustav 712 Reputation points MVP

    Try with:

     sSqlInsert = "Insert into GruppoColl Values ('12343009',TRUE,#2022/06/30 11:57:35#,'RD','Descrizione','TRONCHETTI_RAME_12.IPT','20050082','Tipo B','Bombato',0,'oransen','In')"  
    0 comments No comments