What is wrong with my SQL INSERT syntax?

Owen Ransen 541 Reputation points
2022-06-30T10:06:20.083+00:00

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:

HResult=0x80040E10  
  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:

216534-image.png

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
    2022-06-30T11:32:45.507+00:00

    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
    2022-07-01T08:44:41.383+00:00

    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