Error en store procedure
Publicado por nicowxdvd (11 intervenciones) el 16/03/2011 21:30:20
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
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


0