
Error de sintaxis(falta operador) en la expresion de consulta "IdEMP="
Publicado por JORGE LUIS (3 intervenciones) el 18/08/2017 16:58:32
buenos dias. una consulta, estoy diseñando mi proyecto en vb 6.0
y en el formulario de Empleado. a la hora de guardar el registro me salta este error Error de sintaxis(falta operador) en la expresion de consulta 'IdEMP=".
a continuacion escribo en codigo la funcion que en teoria me tendria que guardar
muchas gracias
y en el formulario de Empleado. a la hora de guardar el registro me salta este error Error de sintaxis(falta operador) en la expresion de consulta 'IdEMP=".
a continuacion escribo en codigo la funcion que en teoria me tendria que guardar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Function Grabar() As Boolean
On Local Error GoTo LineaError
Dim RS As New ADODB.Recordset
RS.CursorLocation = adUseClient
If Trim(TxtIdCliente) = "" Then
MsgBox "Ingrese CODIGO...!", vbExclamation
TxtIdCliente.SetFocus
Exit Function
End If
If Trim(TxtNombre) = "" Then
MsgBox "Ingrese Nombre...!", vbExclamation
TxtNombre.SetFocus
Exit Function
End If
If Trim(TxtApellido) = "" Then
MsgBox "Ingrese Apellido...!", vbExclamation
TxtApellido.SetFocus
Exit Function
End If
If Trim(TxtDNI) = "" Then
MsgBox "Ingrese el Numero de Documento...!", vbExclamation
TxtDNI.SetFocus
Exit Function
End If
Cnx.BeginTrans
If SW = True Then
RS.Open "SELECT * From EMPLEADO", Cnx, adOpenDynamic, adLockOptimistic
RS.AddNew
Else
RS.Open "SELECT * From EMPLEADO where IdEMP=" & TxtId, Cnx, adOpenDynamic, adLockOptimistic -- ------- en esta linea es donde me detecta el error.
End If
RS!CODIGO = Trim$(TxtIdCliente)
RS!APELLIDO = Trim$(TxtApellido)
RS!NOMBRE = Trim$(TxtNombre)
RS!DNI = Trim$(TxtDNI)
RS!NACIMIENTO = Trim$(DTPNAC.Value)
RS!DIRECCION = Trim$(TxtDireccion)
RS!TELEFONO = Trim$(TxtTelefono)
RS!PROFESION = Trim$(TxtIDP)
RS!empresa = Trim$(TxtIDE)
RS!IdUsuario = UsuId
RS!FechaReg = Now
RS.Update
TxtId = RS!IdEMP
Cnx.CommitTrans
Set RS = Nothing
Grabar = True
Exit Function
LineaError:
Cnx.RollbackTrans
MsgBox Err.Description, vbCritical
End Function
Valora esta pregunta


0