S
SiD`
Hi, I am trying to update a field in a record of a Access Database
(whose structure I can not modify).
I got this error (translated from italian): "Data types do not match
in the expression" = "Tipi di dati non corrispondenti nell'espressione
criterio."
The code is the following: (myField is a binary field as on Access
2007)
'determine new value
Dim newValue() As Byte = ... (valid data)
'write new attributes
Dim conn As OleDbConnection = myObj.getConnection
Dim cmd As OleDbCommand = conn.CreateCommand
cmd.CommandType = CommandType.Text
cmd.CommandText = "UPDATE myTable SET myField =
@newValue WHERE fId = @id"
Dim par As New OleDbParameter("@newValue",
OleDbType.Binary)
par.Value = newValue
cmd.Parameters.Add(par)
cmd.Parameters.Add(New OleDbParameter("@id", ID))
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
Does anybody know the problem about it?
Thanks,
Sid.
(whose structure I can not modify).
I got this error (translated from italian): "Data types do not match
in the expression" = "Tipi di dati non corrispondenti nell'espressione
criterio."
The code is the following: (myField is a binary field as on Access
2007)
'determine new value
Dim newValue() As Byte = ... (valid data)
'write new attributes
Dim conn As OleDbConnection = myObj.getConnection
Dim cmd As OleDbCommand = conn.CreateCommand
cmd.CommandType = CommandType.Text
cmd.CommandText = "UPDATE myTable SET myField =
@newValue WHERE fId = @id"
Dim par As New OleDbParameter("@newValue",
OleDbType.Binary)
par.Value = newValue
cmd.Parameters.Add(par)
cmd.Parameters.Add(New OleDbParameter("@id", ID))
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
Does anybody know the problem about it?
Thanks,
Sid.