|
|
|
|
|
Dicas
|
|
Visual Basic (Banco de Dados)
|
|
|
Título da Dica: Otimizar tabelas do MYSQL
|
|
|
|
Postada em 1/3/2007 por ¨Hennyere¨
Public Function Tbl_Otimizar() As Boolean On Error GoTo errHandler Dim rsOptimize As New ADODB.Recordset With rsOptimize .Open "SHOW TABLE STATUS;", db Do While Not (.BOF Or .EOF) db.BeginTrans db.Execute "OPTIMIZE TABLE " & .Fields.Item("Name").Value & ";", , 0 db.CommitTrans .MoveNext Loop End With rsOptimize.Close: Set rsOptimize = Nothing Tbl_Otimizar = True Exit Function errHandler: rsOptimize.Close: Set rsOptimize = Nothing End Function
|
|
|
|
|