J'ai écrit une déclaration sql
qui me permet de retirer les étudiants du Datagrid
. Je veux modifier ce donc il change toutes les valeurs sauf deux champs à 0, quand j'ai essayé de le faire, il me donne cette erreur:SQL instruction ne fonctionne pas correctement
Synatx error in UPDATE statement.
Voici le code orginal: sql = "update Table1 set [Active] = 'No' where ID =" & SID
C'est ce que je modifia à: sql = "update Table1 set [Mark 1 ENG], [Mark 2 ENG] {removed the others so it does not get clustered} = '0' where ID =" & SID
If YNResponse = vbYes Then
sql = "update Table1 set [Mark 1 ENG], [Mark 2 ENG] = '0' where ID =" & SID 'find the student and delete them
If CurrentCon.State = adStateOpen Then
CurrentCon.Close
End If
CurrentCon.Open
CurrentCon.Execute sql
Adodc1.ConnectionString = Conn.connstr
Adodc1.CommandType = adCmdText
Set StudentTable.DataSource = Adodc1
CurrentCon.Close
CurrentCon.Open
Adodc1.Refresh
frmStudents.Adodc1.Recordset.Sort = "[ID] "