De manera directa desde SQL puedes utilizar "Insert Into InfRecepcion " & _ "(FolioRec, Placas, Fecha, LineaTransp, " & _ "Proveedor, Contacto,Comentarios, Remision, " & _ "Plataforma,DocSap, Tipo,Impresa, " & _ "Rollo,Identificacion, Oxidacion,opTipo) " & _ "Values " & _ "( '" & strIndice & "' " & _ ", '" & UCase(Me.txtPlacas.Text) & "' " & _ ", '" & Format(Now, "dd/mm/yyyy hh:mm:ss am/pm") & "' " & _ ", '" & UCase(Me.txtTransporte.Text) & "' " & _ ", '" & UCase(Me.txtDestino.Text) & "' " & _ ", '" & UCase(Me.txtVendedor.Text) & "' " & _ ", '" & UCase(Me.txtComentario.Text) & "' " & _ ", '" & UCase(Me.txtFactura.Text) & "' " & _ ", '" & UCase(Me.txtGondola.Text) & "' " & _ ", '" & UCase(Me.txtDSAP.Text) & "' " & _ ", '" & UCase(Me.cmbTipo.Text) & "' " & _ ", 0 " o creas un storeprocedure y le envías los parámetros por visual basic Dim comando As New ADODB.Command If conexion.State <> 1 Then abrir_conexion_fletes Set comando.ActiveConnection = conexion comando.CommandText = "sp_update_CARRIERS_TRANSPORTISTAS" comando.CommandType = adCmdStoredProc With comando.Parameters .Append comando.CreateParameter("NOMBRE_TABLA", adVarChar, adParamInput, 15, "TRANSPORTISTAS") .Append comando.CreateParameter("Id", adInteger, adParamInput, , txt_Id_transportista.Text) .Append comando.CreateParameter("Nombre", adVarChar, adParamInput, 42, Trim(txt_Nombre.Text)) .Append comando.CreateParameter("Nombrecorto", adVarChar, adParamInput, 17, Trim(txt_Nombrecorto.Text)) .Append comando.CreateParameter("Contacto_1", adVarChar, adParamInput, 52, Trim(txt_Contacto_1.Text)) .Append comando.CreateParameter("Contacto_2", adVarChar, adParamInput, 52, Trim(txt_Contacto_2.Text)) .Append comando.CreateParameter("Tel_1", adVarChar, adParamInput, 22, Trim(txt_Tel_1.Text)) .Append comando.CreateParameter("Tel_2", adVarChar, adParamInput, 22, Trim(txt_Tel_2.Text)) .Append comando.CreateParameter("E_mail_1", adVarChar, adParamInput, 52, Trim(txt_E_mail_1.Text)) .Append comando.CreateParameter("E_mail_2", adVarChar, adParamInput, 52, Trim(txt_E_mail_2.Text)) . Append comando. CreateParameter("Nextel", adVarChar, adParamInput, 22, Trim(txt_Nextel.Text)) . Append comando. CreateParameter("Fax", adVarChar, adParamInput, 22, Trim(txt_Fax.Text)) . Append comando. CreateParameter("Direccion", adVarChar, adParamInput, 72, Trim(txt_Direccion.Text)) . Append comando. CreateParameter("Rfc", adVarChar, adParamInput, 22, Trim(txt_Rfc.Text)) . Append comando. CreateParameter("rc", adInteger, adParamOutput) End With comando.Execute If comando("rc") = 1 Then ' int_mensajes_informacion 3, "el Transportista " & txt_Id_transportista.Text Else int_mensajes_error 3, "El Transportista " & txt_Id_transportista.Text End If
el 30 may. 08