S
sean
Hi,
I am trying to update an access database using an SQL statement, I keep
getting an syntax error in update statment. I am passing in strChkBoxValue
as a string value which is declared in another function. Could someone help
me fix my code.
Sean
Dim oComm As OleDbDataAdapter
Dim sConn As String
Dim oDataSet As New DataSet
Dim word as string
'Build the connection string
sConn = "Provider=Microsoft.Jet.OLEDB.4.0;"
sConn += "Data Source =" & Server.MapPath("email.mdb") & ";"
sConn += "Persist Security Info=False"
Dim strSQL as String = _
"Update members Set Email='" & _
strChkBoxValue & "', " & _
"' WHERE email='" & cstr(strChkBoxValue)
Dim oConn as New OleDBConnection(sConn)
Dim objCmd as New OLEDBCommand(strSQL, oConn)
oConn.open
objCmd.ExecuteNonQuery()
oConn.Close
I am trying to update an access database using an SQL statement, I keep
getting an syntax error in update statment. I am passing in strChkBoxValue
as a string value which is declared in another function. Could someone help
me fix my code.
Sean
Dim oComm As OleDbDataAdapter
Dim sConn As String
Dim oDataSet As New DataSet
Dim word as string
'Build the connection string
sConn = "Provider=Microsoft.Jet.OLEDB.4.0;"
sConn += "Data Source =" & Server.MapPath("email.mdb") & ";"
sConn += "Persist Security Info=False"
Dim strSQL as String = _
"Update members Set Email='" & _
strChkBoxValue & "', " & _
"' WHERE email='" & cstr(strChkBoxValue)
Dim oConn as New OleDBConnection(sConn)
Dim objCmd as New OLEDBCommand(strSQL, oConn)
oConn.open
objCmd.ExecuteNonQuery()
oConn.Close