Ver Mensaje Individual
  #23 (permalink)  
Antiguo 27/06/2007, 05:24
Ana_pm
 
Fecha de Ingreso: junio-2007
Mensajes: 24
Antigüedad: 16 años, 11 meses
Puntos: 0
Re: Convertir a moneda

Public Sub AbrirADO()
'Por si esta abierta la BBDD
Set cnn = Nothing
Set rst = Nothing

'Creamos los objetos
Set cnn = New ADODB.Connection
Set rst = New ADODB.Recordset

'Abrimos la base
cnn.Open "Provider=SQLOLEDB; " & _
"Initial Catalog=" & BDSelec & "; " & _
"Data Source=10.0.0.6; " & _
"integrated security=SSPI; persist security info=True;"
End Sub

Public Sub CerrarADO()
rst.Close
cnn.Close
End Sub


AbrirADO 'Abrimos la base de datos (ver ModuloGeneral)

Dim Cadena As String
valor = "CONVERT(Money, '" & txtTotalBase.Text & "')"

rst.Open "UPDATE Pedido SET CodigoCliente=" & lblIDCLiente.Caption & ", " & _
"CodigoUsuario=" & frmMain.SBLanzador.Panels(1).Text & ", " & _
"ReferenciaCliente='" & txtPedido.Text & "',FechaAlta= '" & txtFecha.Text & "', " & _
"FechaCompromiso='" & txtFechaEntrega.Text & "',CodigoEstado=" & lblEstado.Caption & ", " & _
"Observaciones='" & txtObserPedido.Text & "',Semaforo='V', " & _
"CodigoAlmacen=" & lblIDAlmacen.Caption & ",CodigoDireccion=" & lblIDDireccion.Caption & ", " & _
"DctoProntoPago=" & txtDtoPP.Text & ",DctoOtros1=" & txtDtoca1.Text & ", " & _
"DctoOtros2=" & vNum & ",DctoOtros3=" & vNum & ",ImporteDctoDirecto=Null, " & _
"CodigoPeriodicidad=" & lblIDPeriodicidad.Caption & "," & valor & ", " & _
"TotalDctoProntoPago='" & txtTotalDtoPP.Text & "', " & _
"TotalDctoOtros='" & txtTotalDtoCabecera.Text & "',TotalImpuestos='" & txtTotalIva.Text & "', " & _
"Total='" & txtTotalAlbaran.Text & "',CosteTotal='" & txtTotalCostePedido.Text & "', " & _
"CodigoAgente1=" & lblIDAgente.Caption & ",CodigoAgente2OK=" & lblIDAgente2.Caption & ", " & _
"NumExpediente='" & txtExpediente.Text & "',ValorRecargo='" & txtRecargo.Text & "', " & _
"CodigoMedioPAgoCobro =" & lblIDMedioPago & ",Nota='" & txtNota.Text & "', " & _
"IDRiesgosEMP=" & lblIDEmpresaRiesgo & " WHERE CodigoPedido=" & frmPedidoCliente.Caption & ";", cnn, adOpenDynamic, adLockOptimistic

CerrarADO 'Cerramos la base de datos (ver ModuloGeneral)

Ahi lo tienes, espero que puedas ayudarme. Muchas gracias