Visual Basic - Insercion con ADODB.Connection

Life is soft - evento anual de software empresarial
 
Vista:

Insercion con ADODB.Connection

Publicado por Cesar (10 intervenciones) el 18/03/2005 18:27:04
Gentes,
tengo el problema que en una segunda insercion de esta coneccion no se que hace pero no incerta los valores que incluso explicitamente. Vamos por parte:

1º- agrego una linea para cuando hago el traspaso de datos de una pc a otra
Private Sub AR_CmdCopiarCobertura_Click()
'/Seteo las variables que voy a usar para conectarme a la DB
Dim adoConn As New ADODB.Connection
Dim adoCmd As New ADODB.Command
Dim adoRS As New ADODB.Recordset
Dim strConn As String, strSQL As String

strSQL = "INSERT INTO Versiones_Coberturas (COBERTURA,VERSIÓN,FEINIACTU,FEFINACTU,CODPC,CODUSR,DESCRIACTU,OBSERVAC) VALUES"
strSQL = strSQL & "('" & CodCobertura & "' ,00" & VersiónActualizada & ",'" & tHoy & "','" & tHoy & "','" & MaquinaId & "','" & UsuarioId & "','Cargada a pata','Cargada a pata')"

adoCmd.CommandText = strSQL
adoCmd.CommandType = adCmdText
adoCmd.ActiveConnection = adoConn
adoCmd.Execute
Set adoCmd = Nothing
end sub

Hasta ahi todo bien, despues cuando quiero agregar otra linea hago lo siguiente:

Private Sub AR_GuardarEnServidor_Click()
Dim adoConnServer As New ADODB.Connection
Dim adoCmdServer As New ADODB.Command
Dim adoRSServer As New ADODB.Recordset
strSQLServidor = "INSERT INTO Versiones_Coberturas (COBERTURA,VERSIÓN,FEINIACTU,FEFINACTU,CODPC,CODUSR,DESCRIACTU,OBSERVAC) VALUES"
strSQLServidor = strSQLServidor & "('" & CodCobertura & " ','00" & VersionAnterior & "','" & tHoy & " ','" & tHoy & "','017','000','Descriactu','txt_modificacion.text')"
'" & CodigoServidor & "
'" & CodUsuario & "

adoCmdServer.CommandText = strSQLServidor
adoCmdServer.CommandType = adCmdText
adoCmdServer.ActiveConnection = adoConnServer
adoCmdServer.Execute
End Sub


AHORA ENTOCES EL PROBLEMA ES QUE AUNQUE ESTA LA CONSULTA ESCRITA CASI TODA A MANO NO ME TOMA DOS VALORES QUE TENGO AHI "017" Y '000', ME DA LA IMPRESION QUE LO HACE ANTES NO SE DONDE LA INSERCION SIN QUE YO LE DE LA ORDEN CON OTROS VALORES. TIENEN IDEA DE PORQUE PUEDE LLEGAR A PASAR ESTO? YO INTENTE HACERLO FUNCIONAR BORRANDO LAS CONECCIONES ANTERIORES CON "Set adoCmd = Nothing
Set adoConn = Nothing
Set adoRS = Nothing " Y SIGUE EN LA MISMA. POR FAVOR SI ALGUIEN TIENE IDEA DE COMO SE SOLUCIONA ESTO QUE ME LO HAGA LLEGAR.

Gracias, Cesar
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

RE:Insercion con ADODB.Connection

Publicado por Ayudante (349 intervenciones) el 21/03/2005 17:09:21
Con razón no han contestado, si está requete-rara... podrías explicar mejor sobre esos valores y qué ocurre, porque en realidad no tiene lógica que algo se quede en un "buffer" con ado.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Insercion con ADODB.Connection

Publicado por Cesar (10 intervenciones) el 21/03/2005 17:43:46
En realidad les hice un quilombos a todos los que leyeron y no contestaron o era tan largo el mail que por eso no lo leian/respondian.
En resumen, ya lo resolvi y el tema es que no hacia una segunda insercion en la base de datos cuando debia hacerlo, por lo que me generaba problemas con el registro de transacciones echas por los usuarios. Todo lo resolvi con una simple linea y sencilla: -> "adoConn.Close"
Disculpen por la molestia.

Saludos, Cesar
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar