Problem comes while updating

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am facing problem while updating access 2003 table from vb.net. It works
only if I put value in the where statement. Whenevr I put variable in the
WHERE statement , it doesnt work. My code is given below.:
objConn.Execute("UPDATE SalesTable SET DocNumRef ='" & docno1 & "' WHERE
Salesorder ='" & SoNo& "' ")
i declared docno1, SoNo as integer, and both the fields are number in the
SalesTable.
Please help
thanks in advance
BBN
 
If the values are numeric, they should not have the single quote delimiters
around them. Try ...

objConn.Execute("UPDATE SalesTable SET DocNumRef =" & docno1 & " WHERE
Salesorder =" & SoNo)

The single quotes would be correct for text values.
 
Back
Top