UPDATE problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi;

My problem is updating 2 fields of a record, the code #1 works ok, but the
code #2 fails.

What i want is to UPDATE 5 values.

Thanks on advance

(A)
' Table Clientes Schema
cmd.CommandText = "CREATE TABLE Clientes (" & _
"Id_cliente nchar(5) NOT NULL PRIMARY KEY, " & _
"Nombre nchar(20), " & _
"Contacto nchar(20), " & _
"Direccion nvarchar(20), " & _
"Telefono nchar(8), " & _
"Activo bit)"

(B)
' Here i pass the textboxes values
Dim cId, cNom, cCont, cTel, cDir As String
Dim cAct As Boolean

cId = Me.txtIdCte.Text
cNom = Me.txtNombre.Text
cCont = Me.txtContacto.Text
cTel = Me.txtTelefono.Text
cDir = Me.txtDireccion.Text
cAct = Me.txtActivo.Text

#1
' This Update code works Ok with one field
cmd.CommandText = _
"UPDATE clientes SET nombre=" & cNom & " WHERE id_cliente=" & cId

#2
' This code doesn't work Updating 2 fields
cmd.CommandText = _
"UPDATE clientes SET nombre=" & cNom & _
", contacto=" & cCont & _
" WHERE id_cliente=" & cId

--
David Fúnez
Tegucigalpa, Honduras



.



Relevant Pages

  • Cannot Install Auto Update KB951847
    ... Have had no trouble downloading and updating XP with this method until I ... "Initializing installation... ... Half way through the update it fails. ...
    (microsoft.public.windowsxp.help_and_support)
  • TypeDef or not ???
    ... I am using a TreeView and i'm updating the Tag of every Node ... with a boolean (integer value will give the node an ID and the boolean value ...
    (microsoft.public.dotnet.framework.compactframework)
  • Error 0x80004005
    ... I am trying to update Windows XP machine. ... updating, it fails. ... controls have been enabled. ...
    (microsoft.public.windowsupdate)
  • Service Pack 1 Windows 2000 Pro
    ... I have downloaded Framework 1.1 Service Pack 1 but my computer contiually ... fails to install it. ... updating IE or windows before now. ...
    (microsoft.public.windowsupdate)
  • Windows update
    ... update site but every time it fails. ... trouble with updating before. ...
    (microsoft.public.windowsxp.perform_maintain)