La seguente istruzione Insert Into mi dà errore di sintassi; francamente non riesco a capire il perchè, nonostante abbia provato in tutti i modi, controllato e ricontrollato, c'è qualcosa che non và ma non la rilevo ...
' La Terapia del Cliente NON è presente nel DB viene inserita:
If RSTt1.EOF = True And RSTt1.BOF = True Then
Dim sList1 As String
Dim sList2 As String
Dim i As Integer
Dim j As Integer
sList1 = ""
sList2 = ""
For i = 0 To (FrmInfoTerap.List1.ListCount - 1)
If i = (FrmInfoTerap.List1.ListCount - 1) Then
sList1 = sList1 & FrmInfoTerap.List1.List(i)
Else: sList1 = sList1 & FrmInfoTerap.List1.List(i) & "|"
End If
Next i
For j = 0 To (FrmInfoTerap.List2.ListCount - 1)
If j = (FrmInfoTerap.List2.ListCount - 1) Then
sList2 = sList2 & FrmInfoTerap.List2.List(j)
Else: sList2 = sList2 & FrmInfoTerap.List2.List(j) & "|"
End If
Next j
OggT1.ActiveConnection = CnsT1
OggT1.CommandType = adCmdText
OggT1.CommandText = "insert into TblTerapie(Titolo, Nome, Cognome, CodFisc, NomeDott, Note, TerapiaDisp, TerapiaAppl)" _
& "values ('" & Replace(FrmInfoTerap.TxtCt0x.Text, "'", "''") & "', '" & Replace(FrmInfoTerap.TxtCt1x.Text, "'", "''") & "', '" & Replace(FrmInfoTerap.TxtCt2x.ToolTipText, "'", "''") _
& "', '" & Replace(FrmInfoTerap.TxtCt3x.Text, "'", "''") & "', '" & Replace(FrmInfoTerap.TxtCt4x.Text, "'", "''") & "', '" & Replace(FrmInfoTerap.TxtCt5x.Text, "'", "''") & "', '" & (sList1) & "', '" & (sList2) & "');"
OggT1.Execute
End If
(sList1) e (sList2) sono stringhe che carico con i valori inseriti in due ListBox, come potete rilevare dai cicli sopra esposti.
Grazie per l'aiuto.