Insercion con Adodb.cocnection
Publicado por Cesar (10 intervenciones) el 18/03/2005 18:25:23
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
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


0