This project has moved. For the latest updates, please go here.
1
Vote

Backup file not properly created

description

Even when using these settings
 mb.ExportInfo.AddCreateDatabase = False
mb.ExportInfo.ExportTableStructure = False
mb.ExportInfo.RowsExportMode = RowsDataExportMode.Replace
mb.ExportInfo.ResetAutoIncrement = False
mb.ExportInfo.ExportRows = True
I still find the following code for all tables in the export
DROP TABLE IF EXISTS table_name;
CREATE TABLE IF NOT EXISTS table_name (

comments

adriancs wrote Mar 20 at 4:23 AM

I have tested your code, but the problem does not exist.
It might be caused by another problem.
Try upload a sample project that will re-generate the error.

oghenez wrote Mar 20 at 9:24 AM

True, I figured out the error, i guess i was very tired and didnt notice this line


Initial code
If Not String.IsNullOrEmpty(encryptKey) Then                           
     mb.ExportInfo.AddCreateDatabase = False
     mb.ExportInfo.ExportTableStructure = False
     mb.ExportInfo.RowsExportMode = RowsDataExportMode.Replace
     mb.ExportInfo.ResetAutoIncrement = False
     mb.ExportInfo.ExportRows = True
     mb.ExportInfo.EnableEncryption = True
     mb.ExportInfo.EncryptionPassword = encryptKey
End If
mb.ExportToFile(file)
Fixed code
 mb.ExportInfo.AddCreateDatabase = False
                        mb.ExportInfo.ExportTableStructure = False
                        mb.ExportInfo.RowsExportMode = RowsDataExportMode.Replace
                        mb.ExportInfo.ResetAutoIncrement = False
                        mb.ExportInfo.ExportRows = True
                        If Not String.IsNullOrEmpty(encryptKey) Then
                            mb.ExportInfo.EnableEncryption = True
                            mb.ExportInfo.EncryptionPassword = encryptKey
                        End If
                        mb.ExportToFile(file)