Visual Basic - Store procedure - Error de sintaxis

Life is soft - evento anual de software empresarial
 
Vista:

Store procedure - Error de sintaxis

Publicado por nicowxdvd (11 intervenciones) el 16/03/2011 21:27:35
Estimados:

tengo 2 problemas, el primero es que cada cierto tiempo de maera esporadica me aparece el
sgt error

"Erro Nº:" -2147217900; Error Descrp: [ODBC SQL SERVER DRIVER][SQL SERVER]Linea 1: Sintaxis incorrecta cera de ','.

y lo otro no me esta ejecutando el reloj de arena.

Dim sql As String
Dim xRut As String
Dim i As Integer
Dim xIdMandante As Integer
Dim xNroComprobEjecu As Long
Dim xFolioInterno As Long
Dim xFolio As String
Dim xEstadoDeuda As Long
Dim rec1 As ADODB.Recordset
Dim r As Long
Dim e As String



On Error GoTo Error:
Me.MousePointer = vbHourglass

With grdGrillaSel

For i = 1 To .MaxRows
.Row = i
.Col = 6

If .Value = 1 Then
.Col = 2: xIdMandante = .Text ' Obtiene IdMandante
.Col = 3: xRut = Replace(.Text, ".", "") ' Obtiene Rut
.Col = 17: xFolio = .Text ' Obtiene Folio
xFolioInterno = TraeFolioInterno(xRut, xIdMandante, xFolio) ' Obtiene Folio Interno
.Col = 18: xNroComprobEjecu = .Text ' Obtiene NroComprobEjecu
End If
Next i

End With

r = CLng(xRut)
'parte asumiendo que es pago tipo documento, y si encuentra efectivo le coloca 6
xEstadoDeuda = 5

With grdGrillaPrePagos
For i = 1 To .MaxRows
.Row = i
.Col = 1
If .Text = "Efectivo" Then
xEstadoDeuda = 6
End If
Next i
End With

sql = "stp_finalizapago @Rut = " & r & " , "
sql = sql & " @IdMandante = " & xIdMandante & " , "
sql = sql & " @EstadoDeuda = " & xEstadoDeuda & " , "
sql = sql & " @NroComprobEjecu = " & xNroComprobEjecu

If Not GrlFnSQL(gconConexion, rec1, sql) Then
MsgBox "Ha ocurrido un error en la operación.", vbExclamation: Exit Sub
End If

Screen.MousePointer = 0

Exit Sub
Error:
e = "Error N° : " & err.Number & "; Error Descrip : " & err.Description
Exit Sub

End Sub


gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder