by Williams Castillo (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: VB Script
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (6 Votes)
The purpouse of this module is to backup and restore mysql databases within a Visual Basic program.
Please, don't vote for this one... It is a remake of https://www.vbcoders.com/vb/scripts/ShowCode.asp?txtCodeId=57138&lngWId=1 which inspires me.
It has some improvement on his code: Basically, it take the table creation statement directly from the MySQL engine (so now it publish constrains and indexes correctly) and perfom only on insertion statement per table no matter the number of rows in the table.
Also, it prevent MySQL from generating errors because of the constraing and block the tables before the insertion process.
Also, it could allows the programmers to give feedback to the user about the process and, last but not least, it is IMHO a bit cleaner.
Inputs
Just the filename of the backup file and the connection (ADODB.Connection)
Assumes
The connection should be a valid and active one.
Code Returns
Nothing.
Side Effects
None.
Download Backup and restore MySQL DBs within Visual Basic (2 KB)