UPDATE problem
- From: "David Fúnez" <dfunez@xxxxxxxxxxx>
- Date: Sat, 7 May 2005 09:07:43 -0600
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
.
- Follow-Ups:
- Re: UPDATE problem
- From: Sergey Bogdanov
- Re: UPDATE problem
- From: <ctacke/>
- Re: UPDATE problem
- Prev by Date: Re: PROBLEM WITH WEBREQUEST!!!
- Next by Date: Re: Saving image in picturebox to a jpeg file. Need help!!
- Previous by thread: Error: Cannot establish a connection. Be sure the device is physic
- Next by thread: Re: UPDATE problem
- Index(es):
Relevant Pages
|