• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 271
  • Last Modified:

imporve progress bar

Hi all
How can i implement a progress bar when data transfer procces ocuurs?
i send you the part of the code in where i need a progres bar shows the advance of the upload data.
Thank you a lot

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim button As DialogResult
        Dim b, c As Integer
        Dim a As String


        button = MessageBox.Show _
           ("Esta Usted Seguro de querer migrar las especificaciónes? ", _
               "Migra SPECS", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1)

        If button = Windows.Forms.DialogResult.Yes Then




            ' Dim chk As New DataGridViewCheckBoxCell
            b = Maestro.RowCount.ToString()
            c = b - b
            Do While b
                a = Maestro.Item(0, c).Value
                If a = "T" Then


                    cn5.Open()

                    Dim qry4 As String = "delete  from  proj.pipe_padp"
                    Dim cmd4 As New OleDbCommand(qry4, cn5)
                    estatus = CInt(cmd4.ExecuteScalar())

                    Dim qry6 As String = "INSERT INTO [1010].proj.PIPE_PADP SELECT * FROM [PASO1008].proj.PIPE_PADP "
                    Dim cmd6 As New OleDbCommand(qry6, cn5)
                    estatus = CInt(cmd6.ExecuteScalar())

                    Dim qry5 As String = "delete  from  proj.pipe_padp_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd5 As New OleDbCommand(qry5, cn5)
                    estatus = CInt(cmd5.ExecuteScalar())

                    Dim qry7 As String = "INSERT INTO [1010].proj.PIPE_PADP_SPEC SELECT * FROM [PASO1008].proj.PIPE_PADP_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd7 As New OleDbCommand(qry7, cn5)
                    estatus = CInt(cmd7.ExecuteScalar())

                    Dim qry8 As String = "delete  from  proj.PIPE_PBRN"
                    Dim cmd8 As New OleDbCommand(qry8, cn5)
                    estatus = CInt(cmd8.ExecuteScalar())

                    Dim qry9 As String = "INSERT INTO [1010].proj.PIPE_PBRN SELECT * FROM [PASO1008].proj.PIPE_PBRN "
                    Dim cmd9 As New OleDbCommand(qry9, cn5)
                    estatus = CInt(cmd9.ExecuteScalar())

                    Dim qry10 As String = "delete  from  proj.pipe_PBRN_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd10 As New OleDbCommand(qry10, cn5)
                    estatus = CInt(cmd10.ExecuteScalar())

                    Dim qry11 As String = "INSERT INTO [1010].proj.PIPE_PBRN_SPEC SELECT * FROM [PASO1008].proj.PIPE_PBRN_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd11 As New OleDbCommand(qry11, cn5)
                    estatus = CInt(cmd11.ExecuteScalar())

                    Dim qry12 As String = "delete  from  proj.PIPE_PIPE"
                    Dim cmd12 As New OleDbCommand(qry12, cn5)
                    estatus = CInt(cmd12.ExecuteScalar())

                    Dim qry13 As String = "INSERT INTO [1010].proj.PIPE_PIPE SELECT * FROM [PASO1008].proj.PIPE_PIPE "
                    Dim cmd13 As New OleDbCommand(qry13, cn5)
                    estatus = CInt(cmd13.ExecuteScalar())

                    Dim qry14 As String = "delete  from  proj.pipe_PIPE_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd14 As New OleDbCommand(qry14, cn5)
                    estatus = CInt(cmd14.ExecuteScalar())

                    Dim qry15 As String = "INSERT INTO [1010].proj.PIPE_PIPE_SPEC SELECT * FROM [PASO1008].proj.PIPE_PIPE_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd15 As New OleDbCommand(qry15, cn5)
                    estatus = CInt(cmd15.ExecuteScalar())

                    Dim qry16 As String = "delete  from  proj.PIPE_PNPL"
                    Dim cmd16 As New OleDbCommand(qry16, cn5)
                    estatus = CInt(cmd16.ExecuteScalar())

                    Dim qry17 As String = "INSERT INTO [1010].proj.PIPE_PNPL SELECT * FROM [PASO1008].proj.PIPE_PNPL "
                    Dim cmd17 As New OleDbCommand(qry17, cn5)
                    estatus = CInt(cmd17.ExecuteScalar())

                    Dim qry18 As String = "delete  from  proj.pipe_PNPL_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd18 As New OleDbCommand(qry18, cn5)
                    estatus = CInt(cmd18.ExecuteScalar())

                    Dim qry19 As String = "INSERT INTO [1010].proj.PIPE_PNPL_SPEC SELECT * FROM [PASO1008].proj.PIPE_PNPL_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd19 As New OleDbCommand(qry19, cn5)
                    estatus = CInt(cmd19.ExecuteScalar())

                    Dim qry20 As String = "delete  from  proj.PIPE_PELB"
                    Dim cmd20 As New OleDbCommand(qry20, cn5)
                    estatus = CInt(cmd20.ExecuteScalar())

                    Dim qry21 As String = "INSERT INTO [1010].proj.PIPE_PELB SELECT * FROM [PASO1008].proj.PIPE_PELB "
                    Dim cmd21 As New OleDbCommand(qry21, cn5)
                    estatus = CInt(cmd21.ExecuteScalar())

                    Dim qry22 As String = "delete  from  proj.pipe_PELB_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd22 As New OleDbCommand(qry22, cn5)
                    estatus = CInt(cmd22.ExecuteScalar())

                    Dim qry23 As String = "INSERT INTO [1010].proj.PIPE_PELB_SPEC SELECT * FROM [PASO1008].proj.PIPE_PELB_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd23 As New OleDbCommand(qry23, cn5)
                    estatus = CInt(cmd23.ExecuteScalar())


                    Dim qry24 As String = "delete  from  proj.PIPE_PVLV"
                    Dim cmd24 As New OleDbCommand(qry24, cn5)
                    estatus = CInt(cmd24.ExecuteScalar())

                    Dim qry25 As String = "INSERT INTO [1010].proj.PIPE_PVLV SELECT * FROM [PASO1008].proj.PIPE_PVLV "
                    Dim cmd25 As New OleDbCommand(qry25, cn5)
                    estatus = CInt(cmd25.ExecuteScalar())

                    Dim qry26 As String = "delete  from  proj.pipe_PVLV_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd26 As New OleDbCommand(qry26, cn5)
                    estatus = CInt(cmd26.ExecuteScalar())

                    Dim qry27 As String = "INSERT INTO [1010].proj.PIPE_PVLV_SPEC SELECT * FROM [PASO1008].proj.PIPE_PVLV_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd27 As New OleDbCommand(qry27, cn5)
                    estatus = CInt(cmd27.ExecuteScalar())

                    Dim qry28 As String = "delete  from  proj.PIPE_PVOP"
                    Dim cmd28 As New OleDbCommand(qry28, cn5)
                    estatus = CInt(cmd28.ExecuteScalar())

                    Dim qry29 As String = "INSERT INTO [1010].proj.PIPE_PVOP SELECT * FROM [PASO1008].proj.PIPE_PVOP"
                    Dim cmd29 As New OleDbCommand(qry29, cn5)
                    estatus = CInt(cmd29.ExecuteScalar())

                    Dim qry30 As String = "delete  from  proj.pipe_PVOP_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd30 As New OleDbCommand(qry30, cn5)
                    estatus = CInt(cmd30.ExecuteScalar())

                    Dim qry31 As String = "INSERT INTO [1010].proj.PIPE_PVOP_SPEC SELECT * FROM [PASO1008].proj.PIPE_PVOP_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd31 As New OleDbCommand(qry31, cn5)
                    estatus = CInt(cmd31.ExecuteScalar())

                    Dim qry32 As String = "delete  from  proj.PIPE_PSTR"
                    Dim cmd32 As New OleDbCommand(qry32, cn5)
                    estatus = CInt(cmd32.ExecuteScalar())

                    Dim qry33 As String = "INSERT INTO [1010].proj.PIPE_PSTR SELECT * FROM [PASO1008].proj.PIPE_PSTR"
                    Dim cmd33 As New OleDbCommand(qry33, cn5)
                    estatus = CInt(cmd33.ExecuteScalar())

                    Dim qry34 As String = "delete  from  proj.pipe_PSTR_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd34 As New OleDbCommand(qry34, cn5)
                    estatus = CInt(cmd34.ExecuteScalar())

                    Dim qry35 As String = "INSERT INTO [1010].proj.PIPE_PSTR_SPEC SELECT * FROM [PASO1008].proj.PIPE_PSTR_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd35 As New OleDbCommand(qry35, cn5)
                    estatus = CInt(cmd35.ExecuteScalar())

                    Dim qry36 As String = "delete  from  proj.PIPE_PRED"
                    Dim cmd36 As New OleDbCommand(qry36, cn5)
                    estatus = CInt(cmd36.ExecuteScalar())

                    Dim qry37 As String = "INSERT INTO [1010].proj.PIPE_PRED SELECT * FROM [PASO1008].proj.PIPE_PRED"
                    Dim cmd37 As New OleDbCommand(qry37, cn5)
                    estatus = CInt(cmd37.ExecuteScalar())

                    Dim qry38 As String = "delete  from  proj.pipe_PRED_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd38 As New OleDbCommand(qry38, cn5)
                    estatus = CInt(cmd38.ExecuteScalar())

                    Dim qry39 As String = "INSERT INTO [1010].proj.PIPE_PRED_SPEC SELECT * FROM [PASO1008].proj.PIPE_PRED_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd39 As New OleDbCommand(qry39, cn5)
                    estatus = CInt(cmd39.ExecuteScalar())

                    Dim qry40 As String = "delete  from  proj.PIPE_PFLG"
                    Dim cmd40 As New OleDbCommand(qry40, cn5)
                    estatus = CInt(cmd40.ExecuteScalar())

                    Dim qry41 As String = "INSERT INTO [1010].proj.PIPE_PFLG SELECT * FROM [PASO1008].proj.PIPE_PFLG"
                    Dim cmd41 As New OleDbCommand(qry41, cn5)
                    estatus = CInt(cmd41.ExecuteScalar())

                    Dim qry42 As String = "delete  from  proj.pipe_PFLG_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd42 As New OleDbCommand(qry42, cn5)
                    estatus = CInt(cmd42.ExecuteScalar())

                    Dim qry43 As String = "INSERT INTO [1010].proj.PIPE_PFLG_SPEC SELECT * FROM [PASO1008].proj.PIPE_PFLG_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd43 As New OleDbCommand(qry43, cn5)
                    estatus = CInt(cmd43.ExecuteScalar())

                    Dim qry44 As String = "delete  from  proj.PIPE_PUNI"
                    Dim cmd44 As New OleDbCommand(qry44, cn5)
                    estatus = CInt(cmd44.ExecuteScalar())

                    Dim qry45 As String = "INSERT INTO [1010].proj.PIPE_PUNI SELECT * FROM [PASO1008].proj.PIPE_PUNI"
                    Dim cmd45 As New OleDbCommand(qry45, cn5)
                    estatus = CInt(cmd45.ExecuteScalar())

                    Dim qry46 As String = "delete  from  proj.pipe_PUNI_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd46 As New OleDbCommand(qry46, cn5)
                    estatus = CInt(cmd46.ExecuteScalar())

                    Dim qry47 As String = "INSERT INTO [1010].proj.PIPE_PUNI_SPEC SELECT * FROM [PASO1008].proj.PIPE_PUNI_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd47 As New OleDbCommand(qry47, cn5)
                    estatus = CInt(cmd47.ExecuteScalar())

                    Dim qry48 As String = "delete  from  proj.PIPE_PTRP"
                    Dim cmd48 As New OleDbCommand(qry48, cn5)
                    estatus = CInt(cmd48.ExecuteScalar())

                    Dim qry49 As String = "INSERT INTO [1010].proj.PIPE_PTRP SELECT * FROM [PASO1008].proj.PIPE_PTRP"
                    Dim cmd49 As New OleDbCommand(qry49, cn5)
                    estatus = CInt(cmd49.ExecuteScalar())

                    Dim qry50 As String = "delete  from  proj.pipe_PTRP_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd50 As New OleDbCommand(qry50, cn5)
                    estatus = CInt(cmd50.ExecuteScalar())

                    Dim qry51 As String = "INSERT INTO [1010].proj.PIPE_PTRP_SPEC SELECT * FROM [PASO1008].proj.PIPE_PTRP_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd51 As New OleDbCommand(qry51, cn5)
                    estatus = CInt(cmd51.ExecuteScalar())

                    Dim qry52 As String = "delete  from  proj.PIPE_PSWG"
                    Dim cmd52 As New OleDbCommand(qry52, cn5)
                    estatus = CInt(cmd52.ExecuteScalar())

                    Dim qry53 As String = "INSERT INTO [1010].proj.PIPE_PSWG SELECT * FROM [PASO1008].proj.PIPE_PSWG"
                    Dim cmd53 As New OleDbCommand(qry53, cn5)
                    estatus = CInt(cmd53.ExecuteScalar())

                    Dim qry54 As String = "delete  from  proj.pipe_PSWG_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd54 As New OleDbCommand(qry54, cn5)
                    estatus = CInt(cmd54.ExecuteScalar())

                    Dim qry55 As String = "INSERT INTO [1010].proj.PIPE_PSWG_SPEC SELECT * FROM [PASO1008].proj.PIPE_PSWG_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd55 As New OleDbCommand(qry55, cn5)
                    estatus = CInt(cmd55.ExecuteScalar())

                    Dim qry56 As String = "delete  from  proj.PIPE_PSBN"
                    Dim cmd56 As New OleDbCommand(qry56, cn5)
                    estatus = CInt(cmd56.ExecuteScalar())

                    Dim qry57 As String = "INSERT INTO [1010].proj.PIPE_PSBN SELECT * FROM [PASO1008].proj.PIPE_PSBN"
                    Dim cmd57 As New OleDbCommand(qry57, cn5)
                    estatus = CInt(cmd57.ExecuteScalar())

                    Dim qry58 As String = "delete  from  proj.pipe_PSBN_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd58 As New OleDbCommand(qry58, cn5)
                    estatus = CInt(cmd58.ExecuteScalar())

                    Dim qry59 As String = "INSERT INTO [1010].proj.PIPE_PSBN_SPEC SELECT * FROM [PASO1008].proj.PIPE_PSBN_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd59 As New OleDbCommand(qry59, cn5)
                    estatus = CInt(cmd59.ExecuteScalar())

                    Dim qry60 As String = "delete  from  proj.PIPE_PVLG"
                    Dim cmd60 As New OleDbCommand(qry60, cn5)
                    estatus = CInt(cmd60.ExecuteScalar())

                    Dim qry61 As String = "INSERT INTO [1010].proj.PIPE_PVLG SELECT * FROM [PASO1008].proj.PIPE_PVLG"
                    Dim cmd61 As New OleDbCommand(qry61, cn5)
                    estatus = CInt(cmd61.ExecuteScalar())

                    Dim qry62 As String = "delete  from  proj.pipe_PVLG_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd62 As New OleDbCommand(qry62, cn5)
                    estatus = CInt(cmd62.ExecuteScalar())

                    Dim qry63 As String = "INSERT INTO [1010].proj.PIPE_PVLG_SPEC SELECT * FROM [PASO1008].proj.PIPE_PVLG_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd63 As New OleDbCommand(qry63, cn5)
                    estatus = CInt(cmd63.ExecuteScalar())

                    Dim qry64 As String = "delete  from  proj.PIPE_PGKT"
                    Dim cmd64 As New OleDbCommand(qry64, cn5)
                    estatus = CInt(cmd64.ExecuteScalar())

                    Dim qry65 As String = "INSERT INTO [1010].proj.PIPE_PGKT SELECT * FROM [PASO1008].proj.PIPE_PGKT"
                    Dim cmd65 As New OleDbCommand(qry65, cn5)
                    estatus = CInt(cmd65.ExecuteScalar())

                    Dim qry66 As String = "delete  from  proj.pipe_PGKT_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd66 As New OleDbCommand(qry66, cn5)
                    estatus = CInt(cmd66.ExecuteScalar())

                    Dim qry67 As String = "INSERT INTO [1010].proj.PIPE_PGKT_SPEC SELECT * FROM [PASO1008].proj.PIPE_PGKT_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd67 As New OleDbCommand(qry67, cn5)
                    estatus = CInt(cmd67.ExecuteScalar())

                    Dim qry68 As String = "delete  from  proj.PIPE_PCPL"
                    Dim cmd68 As New OleDbCommand(qry68, cn5)
                    estatus = CInt(cmd68.ExecuteScalar())

                    Dim qry69 As String = "INSERT INTO [1010].proj.PIPE_PCPL SELECT * FROM [PASO1008].proj.PIPE_PCPL"
                    Dim cmd69 As New OleDbCommand(qry69, cn5)
                    estatus = CInt(cmd69.ExecuteScalar())

                    Dim qry70 As String = "delete  from  proj.pipe_PCPL_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd70 As New OleDbCommand(qry70, cn5)
                    estatus = CInt(cmd70.ExecuteScalar())

                    Dim qry71 As String = "INSERT INTO [1010].proj.PIPE_PCPL_SPEC SELECT * FROM [PASO1008].proj.PIPE_PCPL_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd71 As New OleDbCommand(qry71, cn5)
                    estatus = CInt(cmd71.ExecuteScalar())

                    Dim qry72 As String = "delete  from  proj.PIPE_PCAP"
                    Dim cmd72 As New OleDbCommand(qry72, cn5)
                    estatus = CInt(cmd72.ExecuteScalar())

                    Dim qry73 As String = "INSERT INTO [1010].proj.PIPE_PCAP SELECT * FROM [PASO1008].proj.PIPE_PCAP"
                    Dim cmd73 As New OleDbCommand(qry73, cn5)
                    estatus = CInt(cmd73.ExecuteScalar())

                    Dim qry74 As String = "delete  from  proj.pipe_PCAP_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd74 As New OleDbCommand(qry74, cn5)
                    estatus = CInt(cmd74.ExecuteScalar())

                    Dim qry75 As String = "INSERT INTO [1010].proj.PIPE_PCAP_SPEC SELECT * FROM [PASO1008].proj.PIPE_PCAP_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd75 As New OleDbCommand(qry75, cn5)
                    estatus = CInt(cmd75.ExecuteScalar())

                    Dim qry76 As String = "delete  from  proj.PIPE_PPLG"
                    Dim cmd76 As New OleDbCommand(qry76, cn5)
                    estatus = CInt(cmd76.ExecuteScalar())

                    Dim qry77 As String = "INSERT INTO [1010].proj.PIPE_PPLG SELECT * FROM [PASO1008].proj.PIPE_PPLG"
                    Dim cmd77 As New OleDbCommand(qry77, cn5)
                    estatus = CInt(cmd77.ExecuteScalar())

                    Dim qry78 As String = "delete  from  proj.pipe_PPLG_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd78 As New OleDbCommand(qry78, cn5)
                    estatus = CInt(cmd78.ExecuteScalar())

                    Dim qry79 As String = "INSERT INTO [1010].proj.PIPE_PPLG_SPEC SELECT * FROM [PASO1008].proj.PIPE_PPLG_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd79 As New OleDbCommand(qry79, cn5)
                    estatus = CInt(cmd79.ExecuteScalar())

                    Dim qry80 As String = "delete  from  proj.BOLTS"
                    Dim cmd80 As New OleDbCommand(qry80, cn5)
                    estatus = CInt(cmd80.ExecuteScalar())

                    Dim qry81 As String = "INSERT INTO [1010].proj.BOLTS SELECT * FROM [PASO1008].proj.BOLTS"
                    Dim cmd81 As New OleDbCommand(qry81, cn5)
                    estatus = CInt(cmd81.ExecuteScalar())

                    Dim qry82 As String = "delete  from  proj.BOLTS_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd82 As New OleDbCommand(qry82, cn5)
                    estatus = CInt(cmd82.ExecuteScalar())

                    Dim qry83 As String = "INSERT INTO [1010].proj.BOLTS_SPEC SELECT * FROM [PASO1008].proj.BOLTS_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd83 As New OleDbCommand(qry83, cn5)
                    estatus = CInt(cmd83.ExecuteScalar())

                    Dim qry84 As String = "delete  from  proj.PIPE_PERD"
                    Dim cmd84 As New OleDbCommand(qry84, cn5)
                    estatus = CInt(cmd84.ExecuteScalar())

                    Dim qry85 As String = "INSERT INTO [1010].proj.PIPE_PERD SELECT * FROM [PASO1008].proj.PIPE_PERD"
                    Dim cmd85 As New OleDbCommand(qry85, cn5)
                    estatus = CInt(cmd85.ExecuteScalar())

                    Dim qry86 As String = "delete  from  proj.PIPE_PERD_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd86 As New OleDbCommand(qry86, cn5)
                    estatus = CInt(cmd86.ExecuteScalar())

                    Dim qry87 As String = "INSERT INTO [1010].proj.PIPE_PERD_SPEC SELECT * FROM [PASO1008].proj.PIPE_PERD_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd87 As New OleDbCommand(qry87, cn5)
                    estatus = CInt(cmd87.ExecuteScalar())

                    Dim qry88 As String = "delete  from  proj.PIPE_CLMP"
                    Dim cmd88 As New OleDbCommand(qry88, cn5)
                    estatus = CInt(cmd88.ExecuteScalar())

                    Dim qry89 As String = "INSERT INTO [1010].proj.PIPE_CLMP SELECT * FROM [PASO1008].proj.PIPE_CLMP"
                    Dim cmd89 As New OleDbCommand(qry89, cn5)
                    estatus = CInt(cmd89.ExecuteScalar())

                    Dim qry90 As String = "delete  from  proj.PIPE_CLMP_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd90 As New OleDbCommand(qry90, cn5)
                    estatus = CInt(cmd90.ExecuteScalar())

                    Dim qry91 As String = "INSERT INTO [1010].proj.PIPE_CLMP_SPEC SELECT * FROM [PASO1008].proj.PIPE_CLMP_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd91 As New OleDbCommand(qry91, cn5)
                    estatus = CInt(cmd91.ExecuteScalar())

                    Dim qry92 As String = "delete  from  proj.PIPE_BLLW"
                    Dim cmd92 As New OleDbCommand(qry92, cn5)
                    estatus = CInt(cmd92.ExecuteScalar())

                    Dim qry93 As String = "INSERT INTO [1010].proj.PIPE_BLLW SELECT * FROM [PASO1008].proj.PIPE_BLLW"
                    Dim cmd93 As New OleDbCommand(qry93, cn5)
                    estatus = CInt(cmd93.ExecuteScalar())

                    Dim qry94 As String = "delete  from  proj.PIPE_BLLW_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd94 As New OleDbCommand(qry94, cn5)
                    estatus = CInt(cmd94.ExecuteScalar())

                    Dim qry95 As String = "INSERT INTO [1010].proj.PIPE_BLLW_SPEC SELECT * FROM [PASO1008].proj.PIPE_BLLW_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd95 As New OleDbCommand(qry95, cn5)
                    estatus = CInt(cmd95.ExecuteScalar())

                    Dim qry96 As String = "delete  from  proj.PIPE_PBUS"
                    Dim cmd96 As New OleDbCommand(qry96, cn5)
                    estatus = CInt(cmd96.ExecuteScalar())

                    Dim qry97 As String = "INSERT INTO [1010].proj.PIPE_PBUS SELECT * FROM [PASO1008].proj.PIPE_PBUS"
                    Dim cmd97 As New OleDbCommand(qry97, cn5)
                    estatus = CInt(cmd97.ExecuteScalar())

                    Dim qry98 As String = "delete  from  proj.PIPE_PBUS_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd98 As New OleDbCommand(qry98, cn5)
                    estatus = CInt(cmd98.ExecuteScalar())

                    Dim qry99 As String = "INSERT INTO [1010].proj.PIPE_PBUS_SPEC SELECT * FROM [PASO1008].proj.PIPE_PBUS_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd99 As New OleDbCommand(qry99, cn5)
                    estatus = CInt(cmd99.ExecuteScalar())

                    Dim qry100 As String = "delete  from  proj.PIPE_PSWE"
                    Dim cmd100 As New OleDbCommand(qry100, cn5)
                    estatus = CInt(cmd100.ExecuteScalar())

                    Dim qry101 As String = "INSERT INTO [1010].proj.PIPE_PSWE SELECT * FROM [PASO1008].proj.PIPE_PSWE"
                    Dim cmd101 As New OleDbCommand(qry101, cn5)
                    estatus = CInt(cmd101.ExecuteScalar())

                    Dim qry102 As String = "delete  from  proj.PIPE_PSWE_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd102 As New OleDbCommand(qry102, cn5)
                    estatus = CInt(cmd102.ExecuteScalar())

                    Dim qry103 As String = "INSERT INTO [1010].proj.PIPE_PSWE_SPEC SELECT * FROM [PASO1008].proj.PIPE_PSWE_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd103 As New OleDbCommand(qry103, cn5)
                    estatus = CInt(cmd103.ExecuteScalar())

                    Dim qry104 As String = "delete  from  proj.PIPE_FERR"
                    Dim cmd104 As New OleDbCommand(qry104, cn5)
                    estatus = CInt(cmd104.ExecuteScalar())

                    Dim qry105 As String = "INSERT INTO [1010].proj.PIPE_FERR SELECT * FROM [PASO1008].proj.PIPE_FERR"
                    Dim cmd105 As New OleDbCommand(qry105, cn5)
                    estatus = CInt(cmd105.ExecuteScalar())

                    Dim qry106 As String = "delete  from  proj.PIPE_FERR_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd106 As New OleDbCommand(qry106, cn5)
                    estatus = CInt(cmd106.ExecuteScalar())

                    Dim qry107 As String = "INSERT INTO [1010].proj.PIPE_FERR_SPEC SELECT * FROM [PASO1008].proj.PIPE_FERR_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd107 As New OleDbCommand(qry107, cn5)
                    estatus = CInt(cmd107.ExecuteScalar())

                    Dim qry108 As String = "delete  from  proj.PIPE_FLEX"
                    Dim cmd108 As New OleDbCommand(qry108, cn5)
                    estatus = CInt(cmd108.ExecuteScalar())

                    Dim qry109 As String = "INSERT INTO [1010].proj.PIPE_FLEX SELECT * FROM [PASO1008].proj.PIPE_FLEX"
                    Dim cmd109 As New OleDbCommand(qry109, cn5)
                    estatus = CInt(cmd109.ExecuteScalar())

                    Dim qry110 As String = "delete  from  proj.PIPE_FLEX_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd110 As New OleDbCommand(qry110, cn5)
                    estatus = CInt(cmd110.ExecuteScalar())

                    Dim qry111 As String = "INSERT INTO [1010].proj.PIPE_FLEX_SPEC SELECT * FROM [PASO1008].proj.PIPE_FLEX_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd111 As New OleDbCommand(qry111, cn5)
                    estatus = CInt(cmd111.ExecuteScalar())

                    Dim qry112 As String = "delete  from  proj.PIPE_PNOZ_ENDS"
                    Dim cmd112 As New OleDbCommand(qry112, cn5)
                    estatus = CInt(cmd112.ExecuteScalar())

                    Dim qry113 As String = "INSERT INTO [1010].proj.PIPE_PNOZ_ENDS SELECT * FROM [PASO1008].proj.PIPE_PNOZ_ENDS"
                    Dim cmd113 As New OleDbCommand(qry113, cn5)
                    estatus = CInt(cmd113.ExecuteScalar())

                    Dim qry114 As String = "delete  from  proj.PIPE_PNOZ_ENDS_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd114 As New OleDbCommand(qry114, cn5)
                    estatus = CInt(cmd114.ExecuteScalar())

                    Dim qry115 As String = "INSERT INTO [1010].proj.PIPE_PNOZ_ENDS_SPEC SELECT * FROM [PASO1008].proj.PIPE_PNOZ_ENDS_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd115 As New OleDbCommand(qry115, cn5)
                    estatus = CInt(cmd115.ExecuteScalar())

                    Dim qry116 As String = "delete  from  proj.PIPE_POPL"
                    Dim cmd116 As New OleDbCommand(qry116, cn5)
                    estatus = CInt(cmd116.ExecuteScalar())

                    Dim qry117 As String = "INSERT INTO [1010].proj.PIPE_POPL SELECT * FROM [PASO1008].proj.PIPE_POPL"
                    Dim cmd117 As New OleDbCommand(qry117, cn5)
                    estatus = CInt(cmd117.ExecuteScalar())

                    Dim qry118 As String = "delete  from  proj.PIPE_POPL_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd118 As New OleDbCommand(qry118, cn5)
                    estatus = CInt(cmd118.ExecuteScalar())

                    Dim qry119 As String = "INSERT INTO [1010].proj.PIPE_POPL_SPEC SELECT * FROM [PASO1008].proj.PIPE_POPL_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd119 As New OleDbCommand(qry119, cn5)
                    estatus = CInt(cmd119.ExecuteScalar())





                    cn5.Close()


                End If

                b = b - 1
                c = c + 1
            Loop


        End If
        With Maestro
            .Refresh()

        End With

               
        MsgBox("Proceso Concluido")
           





    End Sub

Open in new window

0
Ernesto
Asked:
Ernesto
  • 7
  • 7
1 Solution
 
CodeCruiserCommented:
First point

 b = Maestro.RowCount.ToString()
            c = b - b

c would be 0 right?

Anyways, you can add a progressbar on the form, determine the step value by dividing b by 100.

Dim StepValue As Single = b/100

Then at the end of while loop, increment the value of progressbar by the step value

Progressbar1.Value += StepValue
Application.DoEvents()
0
 
ErnestoAuthor Commented:
do it in the code expert please could youu-?

thanks
0
 
CodeCruiserCommented:
One thing I cant do for you is dragging and dropping a progressbar on the form. Would you be able to do that?



Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim button As DialogResult
        Dim b, c As Integer
        Dim a As String


        button = MessageBox.Show _
           ("Esta Usted Seguro de querer migrar las especificaciónes? ", _
               "Migra SPECS", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1)

        If button = Windows.Forms.DialogResult.Yes Then




            ' Dim chk As New DataGridViewCheckBoxCell
            b = Maestro.RowCount.ToString()
            c = b - b
   
            Dim StepValue As Single = b/100
            Do While b
                a = Maestro.Item(0, c).Value
                If a = "T" Then


                    cn5.Open()

                    Dim qry4 As String = "delete  from  proj.pipe_padp"
                    Dim cmd4 As New OleDbCommand(qry4, cn5)
                    estatus = CInt(cmd4.ExecuteScalar())

                    Dim qry6 As String = "INSERT INTO [1010].proj.PIPE_PADP SELECT * FROM [PASO1008].proj.PIPE_PADP "
                    Dim cmd6 As New OleDbCommand(qry6, cn5)
                    estatus = CInt(cmd6.ExecuteScalar())

                    Dim qry5 As String = "delete  from  proj.pipe_padp_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd5 As New OleDbCommand(qry5, cn5)
                    estatus = CInt(cmd5.ExecuteScalar())

                    Dim qry7 As String = "INSERT INTO [1010].proj.PIPE_PADP_SPEC SELECT * FROM [PASO1008].proj.PIPE_PADP_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd7 As New OleDbCommand(qry7, cn5)
                    estatus = CInt(cmd7.ExecuteScalar())

                    Dim qry8 As String = "delete  from  proj.PIPE_PBRN"
                    Dim cmd8 As New OleDbCommand(qry8, cn5)
                    estatus = CInt(cmd8.ExecuteScalar())

                    Dim qry9 As String = "INSERT INTO [1010].proj.PIPE_PBRN SELECT * FROM [PASO1008].proj.PIPE_PBRN "
                    Dim cmd9 As New OleDbCommand(qry9, cn5)
                    estatus = CInt(cmd9.ExecuteScalar())

                    Dim qry10 As String = "delete  from  proj.pipe_PBRN_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd10 As New OleDbCommand(qry10, cn5)
                    estatus = CInt(cmd10.ExecuteScalar())

                    Dim qry11 As String = "INSERT INTO [1010].proj.PIPE_PBRN_SPEC SELECT * FROM [PASO1008].proj.PIPE_PBRN_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd11 As New OleDbCommand(qry11, cn5)
                    estatus = CInt(cmd11.ExecuteScalar())

                    Dim qry12 As String = "delete  from  proj.PIPE_PIPE"
                    Dim cmd12 As New OleDbCommand(qry12, cn5)
                    estatus = CInt(cmd12.ExecuteScalar())

                    Dim qry13 As String = "INSERT INTO [1010].proj.PIPE_PIPE SELECT * FROM [PASO1008].proj.PIPE_PIPE "
                    Dim cmd13 As New OleDbCommand(qry13, cn5)
                    estatus = CInt(cmd13.ExecuteScalar())

                    Dim qry14 As String = "delete  from  proj.pipe_PIPE_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd14 As New OleDbCommand(qry14, cn5)
                    estatus = CInt(cmd14.ExecuteScalar())

                    Dim qry15 As String = "INSERT INTO [1010].proj.PIPE_PIPE_SPEC SELECT * FROM [PASO1008].proj.PIPE_PIPE_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd15 As New OleDbCommand(qry15, cn5)
                    estatus = CInt(cmd15.ExecuteScalar())

                    Dim qry16 As String = "delete  from  proj.PIPE_PNPL"
                    Dim cmd16 As New OleDbCommand(qry16, cn5)
                    estatus = CInt(cmd16.ExecuteScalar())

                    Dim qry17 As String = "INSERT INTO [1010].proj.PIPE_PNPL SELECT * FROM [PASO1008].proj.PIPE_PNPL "
                    Dim cmd17 As New OleDbCommand(qry17, cn5)
                    estatus = CInt(cmd17.ExecuteScalar())

                    Dim qry18 As String = "delete  from  proj.pipe_PNPL_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd18 As New OleDbCommand(qry18, cn5)
                    estatus = CInt(cmd18.ExecuteScalar())

                    Dim qry19 As String = "INSERT INTO [1010].proj.PIPE_PNPL_SPEC SELECT * FROM [PASO1008].proj.PIPE_PNPL_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd19 As New OleDbCommand(qry19, cn5)
                    estatus = CInt(cmd19.ExecuteScalar())

                    Dim qry20 As String = "delete  from  proj.PIPE_PELB"
                    Dim cmd20 As New OleDbCommand(qry20, cn5)
                    estatus = CInt(cmd20.ExecuteScalar())

                    Dim qry21 As String = "INSERT INTO [1010].proj.PIPE_PELB SELECT * FROM [PASO1008].proj.PIPE_PELB "
                    Dim cmd21 As New OleDbCommand(qry21, cn5)
                    estatus = CInt(cmd21.ExecuteScalar())

                    Dim qry22 As String = "delete  from  proj.pipe_PELB_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd22 As New OleDbCommand(qry22, cn5)
                    estatus = CInt(cmd22.ExecuteScalar())

                    Dim qry23 As String = "INSERT INTO [1010].proj.PIPE_PELB_SPEC SELECT * FROM [PASO1008].proj.PIPE_PELB_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd23 As New OleDbCommand(qry23, cn5)
                    estatus = CInt(cmd23.ExecuteScalar())


                    Dim qry24 As String = "delete  from  proj.PIPE_PVLV"
                    Dim cmd24 As New OleDbCommand(qry24, cn5)
                    estatus = CInt(cmd24.ExecuteScalar())

                    Dim qry25 As String = "INSERT INTO [1010].proj.PIPE_PVLV SELECT * FROM [PASO1008].proj.PIPE_PVLV "
                    Dim cmd25 As New OleDbCommand(qry25, cn5)
                    estatus = CInt(cmd25.ExecuteScalar())

                    Dim qry26 As String = "delete  from  proj.pipe_PVLV_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd26 As New OleDbCommand(qry26, cn5)
                    estatus = CInt(cmd26.ExecuteScalar())

                    Dim qry27 As String = "INSERT INTO [1010].proj.PIPE_PVLV_SPEC SELECT * FROM [PASO1008].proj.PIPE_PVLV_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd27 As New OleDbCommand(qry27, cn5)
                    estatus = CInt(cmd27.ExecuteScalar())

                    Dim qry28 As String = "delete  from  proj.PIPE_PVOP"
                    Dim cmd28 As New OleDbCommand(qry28, cn5)
                    estatus = CInt(cmd28.ExecuteScalar())

                    Dim qry29 As String = "INSERT INTO [1010].proj.PIPE_PVOP SELECT * FROM [PASO1008].proj.PIPE_PVOP"
                    Dim cmd29 As New OleDbCommand(qry29, cn5)
                    estatus = CInt(cmd29.ExecuteScalar())

                    Dim qry30 As String = "delete  from  proj.pipe_PVOP_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd30 As New OleDbCommand(qry30, cn5)
                    estatus = CInt(cmd30.ExecuteScalar())

                    Dim qry31 As String = "INSERT INTO [1010].proj.PIPE_PVOP_SPEC SELECT * FROM [PASO1008].proj.PIPE_PVOP_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd31 As New OleDbCommand(qry31, cn5)
                    estatus = CInt(cmd31.ExecuteScalar())

                    Dim qry32 As String = "delete  from  proj.PIPE_PSTR"
                    Dim cmd32 As New OleDbCommand(qry32, cn5)
                    estatus = CInt(cmd32.ExecuteScalar())

                    Dim qry33 As String = "INSERT INTO [1010].proj.PIPE_PSTR SELECT * FROM [PASO1008].proj.PIPE_PSTR"
                    Dim cmd33 As New OleDbCommand(qry33, cn5)
                    estatus = CInt(cmd33.ExecuteScalar())

                    Dim qry34 As String = "delete  from  proj.pipe_PSTR_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd34 As New OleDbCommand(qry34, cn5)
                    estatus = CInt(cmd34.ExecuteScalar())

                    Dim qry35 As String = "INSERT INTO [1010].proj.PIPE_PSTR_SPEC SELECT * FROM [PASO1008].proj.PIPE_PSTR_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd35 As New OleDbCommand(qry35, cn5)
                    estatus = CInt(cmd35.ExecuteScalar())

                    Dim qry36 As String = "delete  from  proj.PIPE_PRED"
                    Dim cmd36 As New OleDbCommand(qry36, cn5)
                    estatus = CInt(cmd36.ExecuteScalar())

                    Dim qry37 As String = "INSERT INTO [1010].proj.PIPE_PRED SELECT * FROM [PASO1008].proj.PIPE_PRED"
                    Dim cmd37 As New OleDbCommand(qry37, cn5)
                    estatus = CInt(cmd37.ExecuteScalar())

                    Dim qry38 As String = "delete  from  proj.pipe_PRED_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd38 As New OleDbCommand(qry38, cn5)
                    estatus = CInt(cmd38.ExecuteScalar())

                    Dim qry39 As String = "INSERT INTO [1010].proj.PIPE_PRED_SPEC SELECT * FROM [PASO1008].proj.PIPE_PRED_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd39 As New OleDbCommand(qry39, cn5)
                    estatus = CInt(cmd39.ExecuteScalar())

                    Dim qry40 As String = "delete  from  proj.PIPE_PFLG"
                    Dim cmd40 As New OleDbCommand(qry40, cn5)
                    estatus = CInt(cmd40.ExecuteScalar())

                    Dim qry41 As String = "INSERT INTO [1010].proj.PIPE_PFLG SELECT * FROM [PASO1008].proj.PIPE_PFLG"
                    Dim cmd41 As New OleDbCommand(qry41, cn5)
                    estatus = CInt(cmd41.ExecuteScalar())

                    Dim qry42 As String = "delete  from  proj.pipe_PFLG_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd42 As New OleDbCommand(qry42, cn5)
                    estatus = CInt(cmd42.ExecuteScalar())

                    Dim qry43 As String = "INSERT INTO [1010].proj.PIPE_PFLG_SPEC SELECT * FROM [PASO1008].proj.PIPE_PFLG_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd43 As New OleDbCommand(qry43, cn5)
                    estatus = CInt(cmd43.ExecuteScalar())

                    Dim qry44 As String = "delete  from  proj.PIPE_PUNI"
                    Dim cmd44 As New OleDbCommand(qry44, cn5)
                    estatus = CInt(cmd44.ExecuteScalar())

                    Dim qry45 As String = "INSERT INTO [1010].proj.PIPE_PUNI SELECT * FROM [PASO1008].proj.PIPE_PUNI"
                    Dim cmd45 As New OleDbCommand(qry45, cn5)
                    estatus = CInt(cmd45.ExecuteScalar())

                    Dim qry46 As String = "delete  from  proj.pipe_PUNI_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd46 As New OleDbCommand(qry46, cn5)
                    estatus = CInt(cmd46.ExecuteScalar())

                    Dim qry47 As String = "INSERT INTO [1010].proj.PIPE_PUNI_SPEC SELECT * FROM [PASO1008].proj.PIPE_PUNI_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd47 As New OleDbCommand(qry47, cn5)
                    estatus = CInt(cmd47.ExecuteScalar())

                    Dim qry48 As String = "delete  from  proj.PIPE_PTRP"
                    Dim cmd48 As New OleDbCommand(qry48, cn5)
                    estatus = CInt(cmd48.ExecuteScalar())

                    Dim qry49 As String = "INSERT INTO [1010].proj.PIPE_PTRP SELECT * FROM [PASO1008].proj.PIPE_PTRP"
                    Dim cmd49 As New OleDbCommand(qry49, cn5)
                    estatus = CInt(cmd49.ExecuteScalar())

                    Dim qry50 As String = "delete  from  proj.pipe_PTRP_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd50 As New OleDbCommand(qry50, cn5)
                    estatus = CInt(cmd50.ExecuteScalar())

                    Dim qry51 As String = "INSERT INTO [1010].proj.PIPE_PTRP_SPEC SELECT * FROM [PASO1008].proj.PIPE_PTRP_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd51 As New OleDbCommand(qry51, cn5)
                    estatus = CInt(cmd51.ExecuteScalar())

                    Dim qry52 As String = "delete  from  proj.PIPE_PSWG"
                    Dim cmd52 As New OleDbCommand(qry52, cn5)
                    estatus = CInt(cmd52.ExecuteScalar())

                    Dim qry53 As String = "INSERT INTO [1010].proj.PIPE_PSWG SELECT * FROM [PASO1008].proj.PIPE_PSWG"
                    Dim cmd53 As New OleDbCommand(qry53, cn5)
                    estatus = CInt(cmd53.ExecuteScalar())

                    Dim qry54 As String = "delete  from  proj.pipe_PSWG_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd54 As New OleDbCommand(qry54, cn5)
                    estatus = CInt(cmd54.ExecuteScalar())

                    Dim qry55 As String = "INSERT INTO [1010].proj.PIPE_PSWG_SPEC SELECT * FROM [PASO1008].proj.PIPE_PSWG_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd55 As New OleDbCommand(qry55, cn5)
                    estatus = CInt(cmd55.ExecuteScalar())

                    Dim qry56 As String = "delete  from  proj.PIPE_PSBN"
                    Dim cmd56 As New OleDbCommand(qry56, cn5)
                    estatus = CInt(cmd56.ExecuteScalar())

                    Dim qry57 As String = "INSERT INTO [1010].proj.PIPE_PSBN SELECT * FROM [PASO1008].proj.PIPE_PSBN"
                    Dim cmd57 As New OleDbCommand(qry57, cn5)
                    estatus = CInt(cmd57.ExecuteScalar())

                    Dim qry58 As String = "delete  from  proj.pipe_PSBN_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd58 As New OleDbCommand(qry58, cn5)
                    estatus = CInt(cmd58.ExecuteScalar())

                    Dim qry59 As String = "INSERT INTO [1010].proj.PIPE_PSBN_SPEC SELECT * FROM [PASO1008].proj.PIPE_PSBN_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd59 As New OleDbCommand(qry59, cn5)
                    estatus = CInt(cmd59.ExecuteScalar())

                    Dim qry60 As String = "delete  from  proj.PIPE_PVLG"
                    Dim cmd60 As New OleDbCommand(qry60, cn5)
                    estatus = CInt(cmd60.ExecuteScalar())

                    Dim qry61 As String = "INSERT INTO [1010].proj.PIPE_PVLG SELECT * FROM [PASO1008].proj.PIPE_PVLG"
                    Dim cmd61 As New OleDbCommand(qry61, cn5)
                    estatus = CInt(cmd61.ExecuteScalar())

                    Dim qry62 As String = "delete  from  proj.pipe_PVLG_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd62 As New OleDbCommand(qry62, cn5)
                    estatus = CInt(cmd62.ExecuteScalar())

                    Dim qry63 As String = "INSERT INTO [1010].proj.PIPE_PVLG_SPEC SELECT * FROM [PASO1008].proj.PIPE_PVLG_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd63 As New OleDbCommand(qry63, cn5)
                    estatus = CInt(cmd63.ExecuteScalar())

                    Dim qry64 As String = "delete  from  proj.PIPE_PGKT"
                    Dim cmd64 As New OleDbCommand(qry64, cn5)
                    estatus = CInt(cmd64.ExecuteScalar())

                    Dim qry65 As String = "INSERT INTO [1010].proj.PIPE_PGKT SELECT * FROM [PASO1008].proj.PIPE_PGKT"
                    Dim cmd65 As New OleDbCommand(qry65, cn5)
                    estatus = CInt(cmd65.ExecuteScalar())

                    Dim qry66 As String = "delete  from  proj.pipe_PGKT_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd66 As New OleDbCommand(qry66, cn5)
                    estatus = CInt(cmd66.ExecuteScalar())

                    Dim qry67 As String = "INSERT INTO [1010].proj.PIPE_PGKT_SPEC SELECT * FROM [PASO1008].proj.PIPE_PGKT_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd67 As New OleDbCommand(qry67, cn5)
                    estatus = CInt(cmd67.ExecuteScalar())

                    Dim qry68 As String = "delete  from  proj.PIPE_PCPL"
                    Dim cmd68 As New OleDbCommand(qry68, cn5)
                    estatus = CInt(cmd68.ExecuteScalar())

                    Dim qry69 As String = "INSERT INTO [1010].proj.PIPE_PCPL SELECT * FROM [PASO1008].proj.PIPE_PCPL"
                    Dim cmd69 As New OleDbCommand(qry69, cn5)
                    estatus = CInt(cmd69.ExecuteScalar())

                    Dim qry70 As String = "delete  from  proj.pipe_PCPL_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd70 As New OleDbCommand(qry70, cn5)
                    estatus = CInt(cmd70.ExecuteScalar())

                    Dim qry71 As String = "INSERT INTO [1010].proj.PIPE_PCPL_SPEC SELECT * FROM [PASO1008].proj.PIPE_PCPL_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd71 As New OleDbCommand(qry71, cn5)
                    estatus = CInt(cmd71.ExecuteScalar())

                    Dim qry72 As String = "delete  from  proj.PIPE_PCAP"
                    Dim cmd72 As New OleDbCommand(qry72, cn5)
                    estatus = CInt(cmd72.ExecuteScalar())

                    Dim qry73 As String = "INSERT INTO [1010].proj.PIPE_PCAP SELECT * FROM [PASO1008].proj.PIPE_PCAP"
                    Dim cmd73 As New OleDbCommand(qry73, cn5)
                    estatus = CInt(cmd73.ExecuteScalar())

                    Dim qry74 As String = "delete  from  proj.pipe_PCAP_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd74 As New OleDbCommand(qry74, cn5)
                    estatus = CInt(cmd74.ExecuteScalar())

                    Dim qry75 As String = "INSERT INTO [1010].proj.PIPE_PCAP_SPEC SELECT * FROM [PASO1008].proj.PIPE_PCAP_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd75 As New OleDbCommand(qry75, cn5)
                    estatus = CInt(cmd75.ExecuteScalar())

                    Dim qry76 As String = "delete  from  proj.PIPE_PPLG"
                    Dim cmd76 As New OleDbCommand(qry76, cn5)
                    estatus = CInt(cmd76.ExecuteScalar())

                    Dim qry77 As String = "INSERT INTO [1010].proj.PIPE_PPLG SELECT * FROM [PASO1008].proj.PIPE_PPLG"
                    Dim cmd77 As New OleDbCommand(qry77, cn5)
                    estatus = CInt(cmd77.ExecuteScalar())

                    Dim qry78 As String = "delete  from  proj.pipe_PPLG_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd78 As New OleDbCommand(qry78, cn5)
                    estatus = CInt(cmd78.ExecuteScalar())

                    Dim qry79 As String = "INSERT INTO [1010].proj.PIPE_PPLG_SPEC SELECT * FROM [PASO1008].proj.PIPE_PPLG_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd79 As New OleDbCommand(qry79, cn5)
                    estatus = CInt(cmd79.ExecuteScalar())

                    Dim qry80 As String = "delete  from  proj.BOLTS"
                    Dim cmd80 As New OleDbCommand(qry80, cn5)
                    estatus = CInt(cmd80.ExecuteScalar())

                    Dim qry81 As String = "INSERT INTO [1010].proj.BOLTS SELECT * FROM [PASO1008].proj.BOLTS"
                    Dim cmd81 As New OleDbCommand(qry81, cn5)
                    estatus = CInt(cmd81.ExecuteScalar())

                    Dim qry82 As String = "delete  from  proj.BOLTS_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd82 As New OleDbCommand(qry82, cn5)
                    estatus = CInt(cmd82.ExecuteScalar())

                    Dim qry83 As String = "INSERT INTO [1010].proj.BOLTS_SPEC SELECT * FROM [PASO1008].proj.BOLTS_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd83 As New OleDbCommand(qry83, cn5)
                    estatus = CInt(cmd83.ExecuteScalar())

                    Dim qry84 As String = "delete  from  proj.PIPE_PERD"
                    Dim cmd84 As New OleDbCommand(qry84, cn5)
                    estatus = CInt(cmd84.ExecuteScalar())

                    Dim qry85 As String = "INSERT INTO [1010].proj.PIPE_PERD SELECT * FROM [PASO1008].proj.PIPE_PERD"
                    Dim cmd85 As New OleDbCommand(qry85, cn5)
                    estatus = CInt(cmd85.ExecuteScalar())

                    Dim qry86 As String = "delete  from  proj.PIPE_PERD_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd86 As New OleDbCommand(qry86, cn5)
                    estatus = CInt(cmd86.ExecuteScalar())

                    Dim qry87 As String = "INSERT INTO [1010].proj.PIPE_PERD_SPEC SELECT * FROM [PASO1008].proj.PIPE_PERD_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd87 As New OleDbCommand(qry87, cn5)
                    estatus = CInt(cmd87.ExecuteScalar())

                    Dim qry88 As String = "delete  from  proj.PIPE_CLMP"
                    Dim cmd88 As New OleDbCommand(qry88, cn5)
                    estatus = CInt(cmd88.ExecuteScalar())

                    Dim qry89 As String = "INSERT INTO [1010].proj.PIPE_CLMP SELECT * FROM [PASO1008].proj.PIPE_CLMP"
                    Dim cmd89 As New OleDbCommand(qry89, cn5)
                    estatus = CInt(cmd89.ExecuteScalar())

                    Dim qry90 As String = "delete  from  proj.PIPE_CLMP_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd90 As New OleDbCommand(qry90, cn5)
                    estatus = CInt(cmd90.ExecuteScalar())

                    Dim qry91 As String = "INSERT INTO [1010].proj.PIPE_CLMP_SPEC SELECT * FROM [PASO1008].proj.PIPE_CLMP_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd91 As New OleDbCommand(qry91, cn5)
                    estatus = CInt(cmd91.ExecuteScalar())

                    Dim qry92 As String = "delete  from  proj.PIPE_BLLW"
                    Dim cmd92 As New OleDbCommand(qry92, cn5)
                    estatus = CInt(cmd92.ExecuteScalar())

                    Dim qry93 As String = "INSERT INTO [1010].proj.PIPE_BLLW SELECT * FROM [PASO1008].proj.PIPE_BLLW"
                    Dim cmd93 As New OleDbCommand(qry93, cn5)
                    estatus = CInt(cmd93.ExecuteScalar())

                    Dim qry94 As String = "delete  from  proj.PIPE_BLLW_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd94 As New OleDbCommand(qry94, cn5)
                    estatus = CInt(cmd94.ExecuteScalar())

                    Dim qry95 As String = "INSERT INTO [1010].proj.PIPE_BLLW_SPEC SELECT * FROM [PASO1008].proj.PIPE_BLLW_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd95 As New OleDbCommand(qry95, cn5)
                    estatus = CInt(cmd95.ExecuteScalar())

                    Dim qry96 As String = "delete  from  proj.PIPE_PBUS"
                    Dim cmd96 As New OleDbCommand(qry96, cn5)
                    estatus = CInt(cmd96.ExecuteScalar())

                    Dim qry97 As String = "INSERT INTO [1010].proj.PIPE_PBUS SELECT * FROM [PASO1008].proj.PIPE_PBUS"
                    Dim cmd97 As New OleDbCommand(qry97, cn5)
                    estatus = CInt(cmd97.ExecuteScalar())

                    Dim qry98 As String = "delete  from  proj.PIPE_PBUS_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd98 As New OleDbCommand(qry98, cn5)
                    estatus = CInt(cmd98.ExecuteScalar())

                    Dim qry99 As String = "INSERT INTO [1010].proj.PIPE_PBUS_SPEC SELECT * FROM [PASO1008].proj.PIPE_PBUS_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd99 As New OleDbCommand(qry99, cn5)
                    estatus = CInt(cmd99.ExecuteScalar())

                    Dim qry100 As String = "delete  from  proj.PIPE_PSWE"
                    Dim cmd100 As New OleDbCommand(qry100, cn5)
                    estatus = CInt(cmd100.ExecuteScalar())

                    Dim qry101 As String = "INSERT INTO [1010].proj.PIPE_PSWE SELECT * FROM [PASO1008].proj.PIPE_PSWE"
                    Dim cmd101 As New OleDbCommand(qry101, cn5)
                    estatus = CInt(cmd101.ExecuteScalar())

                    Dim qry102 As String = "delete  from  proj.PIPE_PSWE_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd102 As New OleDbCommand(qry102, cn5)
                    estatus = CInt(cmd102.ExecuteScalar())

                    Dim qry103 As String = "INSERT INTO [1010].proj.PIPE_PSWE_SPEC SELECT * FROM [PASO1008].proj.PIPE_PSWE_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd103 As New OleDbCommand(qry103, cn5)
                    estatus = CInt(cmd103.ExecuteScalar())

                    Dim qry104 As String = "delete  from  proj.PIPE_FERR"
                    Dim cmd104 As New OleDbCommand(qry104, cn5)
                    estatus = CInt(cmd104.ExecuteScalar())

                    Dim qry105 As String = "INSERT INTO [1010].proj.PIPE_FERR SELECT * FROM [PASO1008].proj.PIPE_FERR"
                    Dim cmd105 As New OleDbCommand(qry105, cn5)
                    estatus = CInt(cmd105.ExecuteScalar())

                    Dim qry106 As String = "delete  from  proj.PIPE_FERR_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd106 As New OleDbCommand(qry106, cn5)
                    estatus = CInt(cmd106.ExecuteScalar())

                    Dim qry107 As String = "INSERT INTO [1010].proj.PIPE_FERR_SPEC SELECT * FROM [PASO1008].proj.PIPE_FERR_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd107 As New OleDbCommand(qry107, cn5)
                    estatus = CInt(cmd107.ExecuteScalar())

                    Dim qry108 As String = "delete  from  proj.PIPE_FLEX"
                    Dim cmd108 As New OleDbCommand(qry108, cn5)
                    estatus = CInt(cmd108.ExecuteScalar())

                    Dim qry109 As String = "INSERT INTO [1010].proj.PIPE_FLEX SELECT * FROM [PASO1008].proj.PIPE_FLEX"
                    Dim cmd109 As New OleDbCommand(qry109, cn5)
                    estatus = CInt(cmd109.ExecuteScalar())

                    Dim qry110 As String = "delete  from  proj.PIPE_FLEX_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd110 As New OleDbCommand(qry110, cn5)
                    estatus = CInt(cmd110.ExecuteScalar())

                    Dim qry111 As String = "INSERT INTO [1010].proj.PIPE_FLEX_SPEC SELECT * FROM [PASO1008].proj.PIPE_FLEX_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd111 As New OleDbCommand(qry111, cn5)
                    estatus = CInt(cmd111.ExecuteScalar())

                    Dim qry112 As String = "delete  from  proj.PIPE_PNOZ_ENDS"
                    Dim cmd112 As New OleDbCommand(qry112, cn5)
                    estatus = CInt(cmd112.ExecuteScalar())

                    Dim qry113 As String = "INSERT INTO [1010].proj.PIPE_PNOZ_ENDS SELECT * FROM [PASO1008].proj.PIPE_PNOZ_ENDS"
                    Dim cmd113 As New OleDbCommand(qry113, cn5)
                    estatus = CInt(cmd113.ExecuteScalar())

                    Dim qry114 As String = "delete  from  proj.PIPE_PNOZ_ENDS_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd114 As New OleDbCommand(qry114, cn5)
                    estatus = CInt(cmd114.ExecuteScalar())

                    Dim qry115 As String = "INSERT INTO [1010].proj.PIPE_PNOZ_ENDS_SPEC SELECT * FROM [PASO1008].proj.PIPE_PNOZ_ENDS_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd115 As New OleDbCommand(qry115, cn5)
                    estatus = CInt(cmd115.ExecuteScalar())

                    Dim qry116 As String = "delete  from  proj.PIPE_POPL"
                    Dim cmd116 As New OleDbCommand(qry116, cn5)
                    estatus = CInt(cmd116.ExecuteScalar())

                    Dim qry117 As String = "INSERT INTO [1010].proj.PIPE_POPL SELECT * FROM [PASO1008].proj.PIPE_POPL"
                    Dim cmd117 As New OleDbCommand(qry117, cn5)
                    estatus = CInt(cmd117.ExecuteScalar())

                    Dim qry118 As String = "delete  from  proj.PIPE_POPL_spec where spec='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd118 As New OleDbCommand(qry118, cn5)
                    estatus = CInt(cmd118.ExecuteScalar())

                    Dim qry119 As String = "INSERT INTO [1010].proj.PIPE_POPL_SPEC SELECT * FROM [PASO1008].proj.PIPE_POPL_SPEC WHERE SPEC='" & Maestro.Item(1, c).Value & "'"
                    Dim cmd119 As New OleDbCommand(qry119, cn5)
                    estatus = CInt(cmd119.ExecuteScalar())





                    cn5.Close()
           

                End If

                b = b - 1
                c = c + 1

                ProgressBar1.Value += StepValue
                Application.DoEvents()
            Loop


        End If
        Progressbar1.Visible = False
        With Maestro
            .Refresh()

        End With

               
        MsgBox("Proceso Concluido")
           





    End Sub

Open in new window

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
ErnestoAuthor Commented:
shows nothing expert, what more is missing??
thank you a lot
0
 
CodeCruiserCommented:
Did you drag and drop the progressbar on the form? How long does it take to execute the above code?
0
 
ErnestoAuthor Commented:
yes the progres bar is in the form

the time depends on how many specs i need to upload, could be several minutes

thank you a lot
0
 
CodeCruiserCommented:
So you dont see the progressbar at all? Step through the code and see what is the value of StepValue.
0
 
ErnestoAuthor Commented:
ok,
yes i see the progress bar but no see the progress of it you know the  green blocks advanced
only see the progress bar in gray color
thanks
0
 
CodeCruiserCommented:
How many times does the loop run? How many rows there are in the grid?
0
 
ErnestoAuthor Commented:
ok
the loop must run up to 15 times , for testting im looping only one time
it takes about 20 secs aprox
im attaching the for for you to see it
im only migrate C4
Thank you

loop.jpg
0
 
CodeCruiserCommented:
The progressbar updates once every loop so if there is 1 row then the progressbar would not be updated.

You may want to increment the progressbar value at different stages within the loop but that would be highly inacurate as you wont know which command takes how long to execute.

Another option is to use a marque style progressbar as that's more suitable here.
0
 
ErnestoAuthor Commented:
why i do not see the green middle bars?
maybe i do not setting up the progrees bar properly ?
thanks
0
 
CodeCruiserCommented:
As I said above, if there is only 1 row, you wont see the progressbar. Try with many rows.
0
 
ErnestoAuthor Commented:
ok
i need to put a progress value in between every query
im inform you my advance
thank you
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 7
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now