Hi, please i need your help, i had error while i tried to insert into my data base, here is my code:
Try
'preparer les requetes
Dim sqlQRY1 As String = "INSERT INTO AUDIO Values ('" + nomAudio + "')"
Dim sqlQRY2 As String = "INSERT INTO IMAGE(Nom_Img) Values ('" + nomImage + "')"
'ouvrir la connexion
myConnexion.Open()
'creation des commandes
Dim cmd1 As OleDbCommand = New OleDbCommand(sqlQRY1, myConnexion)
Dim cmd2 As OleDbCommand = New OleDbCommand(sqlQRY2, myConnexion)
'exécution des requetes
cmd1.ExecuteNonQuery()
cmd2.ExecuteNonQuery()
MsgBox("Données insérées avec succes")
myConnexion.Close()
Catch ex As Exception
MsgBox(ex.ToString)
Finally
myConnexion.Close()
End Try
to make sure i have tried with only cmd1 and it works but with cmd2 i got error:
System.Data.OleDb.OleDbException:Syntax error in INSERT INTO Statement
thx in advance .