Foros del Web » Programación para mayores de 30 ;) » Programación General » Visual Basic clásico »

Como se Hace un alta en una base de datos con datagrid?

Estas en el tema de Como se Hace un alta en una base de datos con datagrid? en el foro de Visual Basic clásico en Foros del Web. Hola. Ya tengo el datagrid cargado, veo los datos que necesito... Private Sub nmSin_Click() Rem Busqueda por SIN ordenado por Labor descendente Set cnn = ...
  #1 (permalink)  
Antiguo 02/08/2005, 07:38
 
Fecha de Ingreso: julio-2005
Ubicación: vivo en argentina, buenos aires
Mensajes: 33
Antigüedad: 18 años, 10 meses
Puntos: 0
Como se Hace un alta en una base de datos con datagrid?

Hola.

Ya tengo el datagrid cargado, veo los datos que necesito...

Private Sub nmSin_Click()
Rem Busqueda por SIN ordenado por Labor descendente
Set cnn = New ADODB.Connection
Set art = New ADODB.Recordset
Set Prog1 = New ADODB.Recordset
Set Prog2 = New ADODB.Recordset
Set Prog3 = New ADODB.Recordset
Set Prog4 = New ADODB.Recordset
Set Prog5 = New ADODB.Recordset
Set Prog6 = New ADODB.Recordset
Set Etapa1 = New ADODB.Recordset
Set Etapa2 = New ADODB.Recordset
Set Etapa3 = New ADODB.Recordset
Set Etapa4 = New ADODB.Recordset
Set Etapa5 = New ADODB.Recordset
Set Etapa6 = New ADODB.Recordset
With cnn
.ConnectionString = _
"provider=microsoft.jet.oledb.4.0;" & _
"data source=" & spathbase & "\ARGENFLORA.mdb;"
.Open
End With
buscar2 = InputBox("Ingrese la Semana a Buscar:", "Semana Buscada")
If buscar2 = "" Then
mensaje = MsgBox("No existe la Semana Solicitada." _
, vbCritical, "Final de la busqueda")
Rem rst.MoveFirst
Rem Command2.Visible = False
Else
Rem Command2.Visible = True

Prog1.Open "SELECT Prog1.EP1_Programa as PROe1, Prog1.CODIGO as CÓD, Prog1.Cli_Id as CLIE, Prog1.Tam_ID as TAM, Prog1.EP1_Lote as LOTE, Prog1.Lab_ID as LAB, Prog1.EP1_SIN as SIN, Prog1.EP1_Sem_Final as FINAL, Prog1.EP1_Ciclo as CIC, Prog1.EP1_Cant as CANT, Prog1.EP1_Log as LOGRO, Prog1.EP1_Densidad as DENS, Prog1.EP1_D as D, Prog1.EP1_A as A, Prog1.EP1_L as L, Prog1.EP1_Sup as SUP, Prog1.EP1_Fec_Op as FECHA, Prog1.EP1_Observaciones as OBS, Prog1.EP1_Realizado as DONE FROM Prog1 where (str(Prog1.EP1_sin)= ' " & buscar2 & " ' )order by prog1.Codigo, prog1.Lab_Id desc", cnn, adOpenDynamic, adLockOptimistic
Prog2.Open "SELECT Prog2.EP2_Programa as PROe2, Prog2.CODIGO as CÓD, Prog2.Cli_Id as CLIE, Prog2.Tam_ID as TAM, Prog2.EP2_Lote as LOTE, Prog2.Lab_ID as LAB, Prog2.EP2_SIN as SIN, Prog2.EP2_Sem_Final as FINAL, Prog2.EP2_Ciclo as CIC, Prog2.EP2_Cant as CANT, Prog2.EP2_Log as LOGRO, Prog2.EP2_Densidad as DENS, Prog2.EP2_D as D, Prog2.EP2_A as A, Prog2.EP2_L as L, Prog2.EP2_Sup as SUP, Prog2.EP2_Fec_Op as FECHA, Prog2.EP2_Observaciones as OBS, Prog2.EP2_Realizado as DONE FROM Prog2 where (str(Prog2.EP2_sin)= ' " & buscar2 & " ' )order by prog2.Codigo, prog2.Lab_Id desc", cnn, adOpenDynamic, adLockOptimistic
Prog3.Open "SELECT Prog3.EP3_Programa as PROe3, Prog3.CODIGO as CÓD, Prog3.Cli_Id as CLIE, Prog3.Tam_ID as TAM, Prog3.EP3_Lote as LOTE, Prog3.Lab_ID as LAB, Prog3.EP3_SIN as SIN, Prog3.EP3_Sem_Final as FINAL, Prog3.EP3_Ciclo as CIC, Prog3.EP3_Cant as CANT, Prog3.EP3_Log as LOGRO, Prog3.EP3_Densidad as DENS, Prog3.EP3_D as D, Prog3.EP3_A as A, Prog3.EP3_L as L, Prog3.EP3_Sup as SUP, Prog3.EP3_Fec_Op as FECHA, Prog3.EP3_Observaciones as OBS, Prog3.EP3_Realizado as DONE FROM Prog3 where (str(Prog3.EP3_sin)= ' " & buscar2 & " ' )order by prog3.Codigo, prog3.Lab_Id desc", cnn, adOpenDynamic, adLockOptimistic
Prog4.Open "SELECT Prog4.EP4_Programa as PROe4, Prog4.CODIGO as CÓD, Prog4.Cli_Id as CLIE, Prog4.Tam_ID as TAM, Prog4.EP4_Lote as LOTE, Prog4.Lab_ID as LAB, Prog4.EP4_SIN as SIN, Prog4.EP4_Sem_Final as FINAL, Prog4.EP4_Ciclo as CIC, Prog4.EP4_Cant as CANT, Prog4.EP4_Log as LOGRO, Prog4.EP4_Densidad as DENS, Prog4.EP4_D as D, Prog4.EP4_A as A, Prog4.EP4_L as L, Prog4.EP4_Sup as SUP, Prog4.EP4_Fec_Op as FECHA, Prog4.EP4_Observaciones as OBS, Prog4.EP4_Realizado as DONE FROM Prog4 where (str(Prog4.EP4_sin)= ' " & buscar2 & " ' )order by prog4.Codigo, prog4.Lab_Id desc", cnn, adOpenDynamic, adLockOptimistic
Prog5.Open "SELECT Prog5.EP5_Programa as PROe5, Prog5.CODIGO as CÓD, Prog5.Cli_Id as CLIE, Prog5.Tam_ID as TAM, Prog5.EP5_Lote as LOTE, Prog5.Lab_ID as LAB, Prog5.EP5_SIN as SIN, Prog5.EP5_Sem_Final as FINAL, Prog5.EP5_Ciclo as CIC, Prog5.EP5_Cant as CANT, Prog5.EP5_Log as LOGRO, Prog5.EP5_Densidad as DENS, Prog5.EP5_D as D, Prog5.EP5_A as A, Prog5.EP5_L as L, Prog5.EP5_Sup as SUP, Prog5.EP5_Fec_Op as FECHA, Prog5.EP5_Observaciones as OBS, Prog5.EP5_Realizado as DONE FROM Prog5 where (str(Prog5.EP5_sin)= ' " & buscar2 & " ' )order by prog5.Codigo, prog5.Lab_Id desc", cnn, adOpenDynamic, adLockOptimistic
Prog6.Open "SELECT Prog6.EP6_Programa as PROe6, Prog6.CODIGO as CÓD, Prog6.Cli_Id as CLIE, Prog6.Tam_ID as TAM, Prog6.EP6_Lote as LOTE, Prog6.Lab_ID as LAB, Prog6.EP6_SIN as SIN, Prog6.EP6_Sem_Final as FINAL, Prog6.EP6_Ciclo as CIC, Prog6.EP6_Cant as CANT, Prog6.EP6_Log as LOGRO, Prog6.EP6_Densidad as DENS, Prog6.EP6_D as D, Prog6.EP6_A as A, Prog6.EP6_L as L, Prog6.EP6_Sup as SUP, Prog6.EP6_Fec_Op as FECHA, Prog6.EP6_Observaciones as OBS, Prog6.EP6_Realizado as DONE FROM Prog6 where (str(Prog6.EP6_sin)= ' " & buscar2 & " ' )order by prog6.Codigo, prog6.Lab_Id desc", cnn, adOpenDynamic, adLockOptimistic
Etapa1.CursorLocation = adUseClient
Etapa1.Open "SELECT Etapa1.CODIGO as CÓD, Etapa1.Tam_ID as TAM, Etapa1.Eta1_Lote as LOTE, Etapa1.Eta1_Lote_Id as IDLOTE, Etapa1.Lab_ID as LAB, Etapa1.Sec_ID as SEC, Etapa1.Emp_ID as EMP, Etapa1.Eta1_SIN as SIN, Etapa1.Eta1_Sem_Final as FINAL, Etapa1.Eta1_Ciclo as CIC, Etapa1.Eta1_Cant as CANT, Etapa1.Eta1_Log as LOGRO, Etapa1.Eta1_Densidad as DENS, Etapa1.Eta1_D as D, Etapa1.Eta1_A as A, Etapa1.Eta1_L as L, Etapa1.Eta1_Sup as SUP, Etapa1.Eta1_Fec_Op as FECHA, Etapa1.Eta1_Recomendaciones as RECOMEND, Etapa1.Eta1_Observaciones as OBS, Etapa1.Eta1_Realizado as DONE FROM Etapa1 where (str(Etapa1.Eta1_sin)= ' " & buscar2 & " ' )order by Etapa1.Codigo, Etapa1.Lab_Id desc", cnn, adOpenDynamic, adLockOptimistic
Etapa2.Open "SELECT Etapa2.CODIGO as CÓD, Etapa2.Tam_ID as TAM, Etapa2.Eta2_Lote as LOTE, Etapa2.Eta2_Lote_Id as IDLOTE, Etapa2.Lab_ID as LAB, Etapa2.Sec_ID as SEC, Etapa2.Emp_ID as EMP, Etapa2.Eta2_SIN as SIN, Etapa2.Eta2_Sem_Final as FINAL, Etapa2.Eta2_Ciclo as CIC, Etapa2.Eta2_Cant as CANT, Etapa2.Eta2_Log as LOGRO, Etapa2.Eta2_Densidad as DENS, Etapa2.Eta2_D as D, Etapa2.Eta2_A as A, Etapa2.Eta2_L as L, Etapa2.Eta2_Sup as SUP, Etapa2.Eta2_Fec_Op as FECHA, Etapa2.Eta2_Recomendaciones as RECOMEND, Etapa2.Eta2_Observaciones as OBS, Etapa2.Eta2_Realizado as DONE FROM Etapa2 where (str(Etapa2.Eta2_sin)= ' " & buscar2 & " ' )order by Etapa2.Codigo, Etapa2.Lab_Id desc", cnn, adOpenDynamic, adLockOptimistic
Etapa3.Open "SELECT Etapa3.CODIGO as CÓD, Etapa3.Tam_ID as TAM, Etapa3.Eta3_Lote as LOTE, Etapa3.Eta3_Lote_Id as IDLOTE, Etapa3.Lab_ID as LAB, Etapa3.Sec_ID as SEC, Etapa3.Emp_ID as EMP, Etapa3.Eta3_SIN as SIN, Etapa3.Eta3_Sem_Final as FINAL, Etapa3.Eta3_Ciclo as CIC, Etapa3.Eta3_Cant as CANT, Etapa3.Eta3_Log as LOGRO, Etapa3.Eta3_Densidad as DENS, Etapa3.Eta3_D as D, Etapa3.Eta3_A as A, Etapa3.Eta3_L as L, Etapa3.Eta3_Sup as SUP, Etapa3.Eta3_Fec_Op as FECHA, Etapa3.Eta3_Recomendaciones as RECOMEND, Etapa3.Eta3_Observaciones as OBS, Etapa3.Eta3_Realizado as DONE FROM Etapa3 where (str(Etapa3.Eta3_sin)= ' " & buscar2 & " ' )order by Etapa3.Codigo, Etapa3.Lab_Id desc", cnn, adOpenDynamic, adLockOptimistic
Etapa4.Open "SELECT Etapa4.CODIGO as CÓD, Etapa4.Tam_ID as TAM, Etapa4.Eta4_Lote as LOTE, Etapa4.Eta4_Lote_Id as IDLOTE, Etapa4.Lab_ID as LAB, Etapa4.Sec_ID as SEC, Etapa4.Emp_ID as EMP, Etapa4.Eta4_SIN as SIN, Etapa4.Eta4_Sem_Final as FINAL, Etapa4.Eta4_Ciclo as CIC, Etapa4.Eta4_Cant as CANT, Etapa4.Eta4_Log as LOGRO, Etapa4.Eta4_Densidad as DENS, Etapa4.Eta4_D as D, Etapa4.Eta4_A as A, Etapa4.Eta4_L as L, Etapa4.Eta4_Sup as SUP, Etapa4.Eta4_Fec_Op as FECHA, Etapa4.Eta4_Recomendaciones as RECOMEND, Etapa4.Eta4_Observaciones as OBS, Etapa4.Eta4_Realizado as DONE FROM Etapa4 where (str(Etapa4.Eta4_sin)= ' " & buscar2 & " ' )order by Etapa4.Codigo, Etapa4.Lab_Id desc", cnn, adOpenDynamic, adLockOptimistic
Etapa5.Open "SELECT Etapa5.CODIGO as CÓD, Etapa5.Tam_ID as TAM, Etapa5.Eta5_Lote as LOTE, Etapa5.Eta5_Lote_Id as IDLOTE, Etapa5.Lab_ID as LAB, Etapa5.Sec_ID as SEC, Etapa5.Emp_ID as EMP, Etapa5.Eta5_SIN as SIN, Etapa5.Eta5_Sem_Final as FINAL, Etapa5.Eta5_Ciclo as CIC, Etapa5.Eta5_Cant as CANT, Etapa5.Eta5_Log as LOGRO, Etapa5.Eta5_Densidad as DENS, Etapa5.Eta5_D as D, Etapa5.Eta5_A as A, Etapa5.Eta5_L as L, Etapa5.Eta5_Sup as SUP, Etapa5.Eta5_Fec_Op as FECHA, Etapa5.Eta5_Recomendaciones as RECOMEND, Etapa5.Eta5_Observaciones as OBS, Etapa5.Eta5_Realizado as DONE FROM Etapa5 where (str(Etapa5.Eta5_sin)= ' " & buscar2 & " ' )order by Etapa5.Codigo, Etapa5.Lab_Id desc", cnn, adOpenDynamic, adLockOptimistic
Etapa6.Open "SELECT Etapa6.CODIGO as CÓD, Etapa6.Tam_ID as TAM, Etapa6.Eta6_Lote as LOTE, Etapa6.Eta6_Lote_Id as IDLOTE, Etapa6.Lab_ID as LAB, Etapa6.Sec_ID as SEC, Etapa6.Emp_ID as EMP, Etapa6.Eta6_SIN as SIN, Etapa6.Eta6_Sem_Final as FINAL, Etapa6.Eta6_Ciclo as CIC, Etapa6.Eta6_Cant as CANT, Etapa6.Eta6_Log as LOGRO, Etapa6.Eta6_Densidad as DENS, Etapa6.Eta6_D as D, Etapa6.Eta6_A as A, Etapa6.Eta6_L as L, Etapa6.Eta6_Sup as SUP, Etapa6.Eta6_Fec_Op as FECHA, Etapa6.Eta6_Recomendaciones as RECOMEND, Etapa6.Eta6_Observaciones as OBS, Etapa6.Eta6_Realizado as DONE FROM Etapa6 where (str(Etapa6.Eta6_sin)= ' " & buscar2 & " ' )order by Etapa6.Codigo, Etapa6.Lab_Id desc", cnn, adOpenDynamic, adLockOptimistic
Set MSHFlexGrid1(0).DataSource = Prog1
Set MSHFlexGrid1(1).DataSource = Prog2
Set MSHFlexGrid1(2).DataSource = Prog3
Set MSHFlexGrid1(3).DataSource = Prog4
Set MSHFlexGrid1(4).DataSource = Prog5
Set MSHFlexGrid1(5).DataSource = Prog6

Set Form12.DataGrid1.DataSource = Etapa1
Rem Set Form4.MSHFlexGrid1(0).DataSource = Etapa1
Set Form5.MSHFlexGrid1(1).DataSource = Etapa2
Set Form8.MSHFlexGrid1(2).DataSource = Etapa3
Set Form9.MSHFlexGrid1(3).DataSource = Etapa4
Set Form10.MSHFlexGrid1(4).DataSource = Etapa5
Set Form11.MSHFlexGrid1(5).DataSource = Etapa6
End If
Nover
End Sub


Pero ahora necesito modificar algunos datos de la base usando el datagrid.
Muchas gracias
Marcos
  #2 (permalink)  
Antiguo 03/08/2005, 07:11
 
Fecha de Ingreso: julio-2005
Ubicación: vivo en argentina, buenos aires
Mensajes: 33
Antigüedad: 18 años, 10 meses
Puntos: 0
Ayuda por favor
  #3 (permalink)  
Antiguo 08/08/2005, 14:46
 
Fecha de Ingreso: julio-2005
Ubicación: vivo en argentina, buenos aires
Mensajes: 33
Antigüedad: 18 años, 10 meses
Puntos: 0
Ya lo averigue...

Muchas gracias por colaborar.

Marcos
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:21.