A través de este código vacío una tabla en ACCESS, el problema es que tarda mucho... y no me explico porque, aunque este vacía tarda de 3 a 5 minutos para terminar.
Estoy haciendo algo mal?? El archivo de access esta en el PC local.
Dim Connection As New System.Data.OleDb.OleDbConnection
Dim Command As New System.Data.OleDb.OleDbCommand
Connection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\Users\yo\Desktop\db.accdb"
Command.Connection = Connection
Connection.Open()
Try
Dim increment As Integer = 0
Dim str1 As String
For x As Integer = 0 To DataGridView1.Rows.Count - 2
increment = increment + 1
If increment > ToolStripProgressBar1.Maximum Then
increment = ToolStripProgressBar1.Maximum
End If
str1 = "DELETE saldi.* FROM saldi"
Dim com As New OleDb.OleDbCommand(str1, Connection)
com.ExecuteNonQuery()
ToolStripProgressBar1.Value = increment
Next
Connection.Close()
MessageBox.Show("Tabla vacia! '" + TimeOfDay + "'", "Query Vacia Tabla", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As OleDb.OleDbException
MsgBox(ex.Message, MsgBoxStyle.Critical, "Oledb Error")
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "General Error")
End Try
Gracias! Saludos!