我正在尝试更新数据库中的信息,但显然缺少运营商。有人可以帮我吗?
Dim con As OleDbConnection
con = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source= \\SERVER\RedirectedFolders\simono\Desktop\TechnoProjectManager\version 2.accdb")
Dim sql As String = "UPDATE SuiviPojet SET [NUMERO DE TC]='" & txtNumeroTC.Text & "' [STATUS]='" & status & "' [INGENIERIE]='" & ingenierie & "' [NOM DU PROJET ]='" & txtNomProjet.Text & "' [CLIENT FINAL]='" & txtClientFinal.Text & "' [CLIENT ACOMBA]='" & txtClientAcomba.Text & "' [DATE APPROBATION]='" & DTP_APPROBATION.Text & "' [DATE LIVRAISON]='" & DTP_LIVRAISON.Text & "' [NOTES]='" & RTB_NOTES.Text & "' WHERE [NUMERO DE TC]='" & txtNumeroTC.Text & "'"
con.Open()
Dim cmdUpdate As New OleDbCommand(sql, con)
cmdUpdate.ExecuteNonQuery()
con.Close()
答案 0 :(得分:0)
最有可能在SQL语句中将“sql”放在MsgBox中并查看所有单引号和值是否正确。