Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/09/2010, 20:51
Avatar de juan_14nob
juan_14nob
 
Fecha de Ingreso: abril-2010
Mensajes: 552
Antigüedad: 14 años
Puntos: 6
Error de sintaxis (falta operador)

Hola a todos.. no se por que me marca un error y me dice:"Error de sintaxis (falta operador) en la expresion de consulta 'nro_legajo = '

Si alguien me puede ayudar se lo agradeceria.. desde ya muchas gracias

aqui dejo el codigo para quie lo vean



---------------------------------------------------------------------------------
Private Sub Form_Activate()
Call conectar
' conexion = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Parcial\parcial.mdb;Persist Security Info=False"
' No es necesario hacer 2 veces la coneccion, esta demas la coneccion de arriba.
End Sub
---------------------------------------------------------------------------------
Private Sub conectar()
' Subrutina para realizar las conecciones a los Adodc y cargar los datos en el datagrid1
conexion = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrador\Escritorio\recup\personal.m db;Persist Security Info=False"

Adodc1.ConnectionString = conexion
' Se establece la coneccion con la bace de datos


Adodc1.RecordSource = "Select * from jornal"
Adodc1.CursorLocation = adUseClient
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
Text1.SetFocus
End Sub
---------------------------------------------------------------------------------
Private Sub Command2_Click()

bandera = 0
Adodc1.Refresh

If IsNumeric(Text1) = False Then
e = MsgBox("Debe ingresar un numero", vbInformation + vbOKOnly, "Atencion!")
Text1 = " "
Else
With Adodc1.Recordset
.MoveFirst
Do While Not .EOF
If !nro_legajo = Val(Text1) Then
Text1 = !nro_legajo
Text2 = !horas_Extras
bandera = 1
Exit Do
End If
.MoveNext
Loop
If bandera = 0 Then
Text1 = " "
Text2 = " "
w = MsgBox("No encontrado el registro", vbInformation, "atention")
End If
End With

Text1.SetFocus

End If

End Sub
---------------------------------------------------------------------------------
Private Sub Command1_Click()

Adodc1.RecordSource = "Select * from jornal where nro_legajo = " & horas_Extras & ""


Adodc1.Refresh
With Adodc1.Recordset

!horas_Extras = Val(Text2)

.Update

End With

Adodc1.Refresh

Call conectar

Text1 = ""
Text2 = ""
Text2.SetFocus
End Sub

Private Sub Text1_Change()

End Sub