| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Easily export MS Access databases to SQL scripts!
This project provides a Python-based utility to export the structure and data of MS Access databases (.mdb, .accdb) into an SQL script. The tool ensures the correct handling of table structures, primary keys, and foreign key relationships, allowing for a smooth migration to other SQL-based databases.
This tool is ideal for professionals who deal with MS Access databases and need to migrate, integrate, or back up their data in SQL format:
Data Engineers: Simplify ETL (Extract, Transform, Load) processes by seamlessly incorporating MS Access databases into modern SQL-based systems. See issue #16 for our plans to support command-line execution, making automation even easier.
Database Administrators: Save time and effort when exporting complex MS Access databases while maintaining referential integrity. The planned feature for saving and loading configurations will make repetitive export tasks effortless.
Developers: Work with legacy MS Access data using familiar SQL scripts for modern web and software development.
Command-line Execution (#16) (In process)
Save and Load Configurations (#17) (Done)
git clone https://github.com/whellcome/MSAccessToSQL
cd MSAccessToSQL
pip install -r requirements.txtThis project relies on the tkextras module, which enhances functionality for working with the tkinter interface. The tkextras module, along with other dependencies, is included in the requirements.txt file.
Note: If the tkextras module does not install automatically, you can manually install it using the following command:
pip install tkextrasThe MS Access to SQL Export Tool supports both graphical mode and command-line execution for automated exports.
To configure your export settings, follow these steps:
python export-msaccess-sql.pyOnce a configuration file is created, the export process can be executed without user interaction.
Run the script with the -c or --config parameter to specify the configuration file:
python export-msaccess-sql.py -c my_config.jsonThe script will automatically load the configuration and execute the export.
The execution log is displayed in the console.
If a logging file specified, logging is duplicated to the file
💡 This feature allows data engineers and database administrators to integrate the tool into ETL pipelines and automate migration processes. 🚀
To ensure the application functions correctly, read access to the system tables (MSysObjects and MSysRelationships) in your Access database is required. Without this access, the application will not be able to extract necessary metadata.
Steps to Grant Permissions:
Sub GrantPermissions()
On Error Resume Next
Dim strDdl As String
strDdl = "GRANT SELECT ON MSysObjects TO Admin;"
CurrentProject.Connection.Execute strDdl
strDdl = "GRANT SELECT ON MSysRelationships TO Admin;"
CurrentProject.Connection.Execute strDdl
If Err.Number = 0 Then
MsgBox "Permissions granted successfully.", vbInformation
Else
MsgBox "Failed to grant permissions. Error: " & Err.Description, vbCritical
End If
End SubIf you do not have access to modify permissions, please contact your database administrator.
Graphical User Interface (GUI) (Done):
Data Integrity Control (Done):
Advanced Export Options (Done):
The following is a sample SQL snippet generated by the tool:
-- Table: Ref_Countries
CREATE TABLE 'Ref_Countries' (
'ID' Integer NOT NULL,
'Name' Text(255) NOT NULL,
PRIMARY KEY (ID)
);
-- Filling data for Ref_Countries
INSERT INTO 'Ref_Countries' (ID, Name) VALUES
(1, 'United States'),
(2, 'Germany'),
(3, 'France');We welcome feedback, suggestions, and contributions to make this tool better. If you'd like to contribute, feel free to submit issues or pull requests.
If you find this tool helpful and want to support its development, consider buying me a coffee. ☕
Stay tuned for updates and new features! 🚀
| Back | FazBrowse Home | New Git URL |