VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "C_CODCOMPRA"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Public Function EditarCodigoCompra(ByVal codProveedor As String, ByVal CodArticulo As String, _
                                   ByVal codAlmacen As String, ByVal nCodCompra As String) As Boolean
'Autor: Jorge Illescas................permite editar el precio de venta de un producto desde el maestro ingreso
'de articulos.................................................................................................

Dim cmd As ADODB.Command
Dim con As ADODB.Connection

On Error GoTo ErrorHandler
 
Set cmd = New ADODB.Command
cmd.CommandText = " IN_EditarCodCompraArt '" & codProveedor & "','" & CodArticulo & "'," & _
                                                                "'" & codAlmacen & "'," & nCodCompra & ""

Set con = New ADODB.Connection
con.Open "FILEDSN=conexionsies"

Set cmd.ActiveConnection = con
cmd.Execute

'GetObjectContext.SetComplete
    EditarCodigoCompra = True
Exit Function
    
ErrorHandler:
     
    Dim LStrMensajeError As String
    Dim LVarNumeroError As Variant
    
    If Not cmd Is Nothing Then
       Set cmd = Nothing
    End If

    If Not con Is Nothing Then
       LStrMensajeError = con.Errors(con.Errors.Count - 2).Description
       LVarNumeroError = con.Errors(con.Errors.Count - 2).NativeError
       Set con = Nothing
    End If
     
     'GetObjectContext.SetAbort
     EditarCodigoCompra = False
     Err.Raise LVarNumeroError, "DB_INV_MOVIMIENTOS.EditarCodigoCompra", LStrMensajeError

End Function

