pierchi usa le query parametriche è l'unica cosa che non hai provato no? e Myitaly , che ha suggerito la cosa, è uno che la sa lunga

codice:
  1. Dim strSQL As String
  2. strSQL = "INSERT INTO test (a,b,c,d) VALUES(?,?,?,?)"
  3. Dim adoCommand As ADODB.Command
  4. Set adoCommand = New ADODB.Command
  5. With adoCommand
  6. 'Replace adoConnection with the name of your connection object
  7. .ActiveConnection = adoConnection
  8. .CommandType = adCmdText
  9. .CommandText = strSQL
  10. .Prepared = True
  11. .Parameters.Append .CreateParameter(, adVarChar, adParamInput, 50, Data1)
  12. .Parameters.Append .CreateParameter(, adBoolean, adParamInput, , Data2)
  13. .Parameters.Append .CreateParameter(, adInteger, adParamInput, , Data3)
  14. .Parameters.Append .CreateParameter(, adDate, adParamInput, , Data4)
  15. .Execute , , adCmdText + adExecuteNoRecords
  16. 'note: the last two arguments used for Execute here makes the execution of the command faster
  17. End With
copiato e incollato da un altro sito