Re: Migrating from MS Access to MySQL
Posted by:
stepher r
Date: December 20, 2005 02:04PM
Sebastien,
Again, thanks for the support.
I need to admit upfront that I am not a hardcore programmer. I prob'ly know enough to get into trouble (but apparently not enough to get out of it ;)
I generated the script (below) and I received 3 error messages, all 1064 "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near..." followed by the specific script dialog. I noted where these errors supposedly occurred with an "*>". Also, I am using JDBC as my connection. I noticed in the script that the variable jdbcConnStr has an empty string associated with it. Should this be happening (I noticed in MT that if I click on "Advance" there is a place I can enter a jdbcconnect string...are these related?)? Should I be using ODBC instead, and I am only causing myself headaches with JDBC? What are the advantages/disadvantages of either?
One other Q...In a previous email you suggested (dis)enabling the strict server option for MySQL. In MySQL Administrator there appears to be a box to do this (which is how I acted on your suggestion). is this OK, or do I need to completely uninstall MySQL5.0 and then reinstall it with this option disabled?
Regards...Steph
Generated Script:
-- ------------------------------------------------------------------
-- MySQL Migration Toolkit - Migration script
-- ------------------------------------------------------------------
-- ------------------------------------------------------------------
-- Initialize the migration environment
Migration:initMigration()
-- set options
*> doWriteCreateScript= false
doWriteInsertScript= false
-- ------------------------------------------------------------------
-- checkpoint 0
-- Set source and target connection
do
-- Set source connection
print("Set source connection.")
grtV.setGlobal("/migration/sourceConnection", {
name= "sourceConn",
_id= grt.newGuid(),
driver= "{A8F2E8C2-415A-48C5-B8F8-95EE6E7D4FDB}",
parameterValues= {
databaseFile= "D:\\IPS\\InspectionDB.mdb",
jdbcConnStr= "",
password= "",
username= ""
},
modules= {
MigrationModule= "MigrationAccess",
ReverseEngineeringModule= "ReverseEngineeringAccess",
TransformationModule= ""
}
});
-- set struct and types
*> grtS.set(grtV.getGlobal("/migration/sourceConnection"), "db.mgmt.Connection")
grtV.setContentType(grtV.getGlobal("/migration/sourceConnection/parameterValues"), "string")
grtV.setContentType(grtV.getGlobal("/migration/sourceConnection/modules"), "string")
sourceConn= grtV.getGlobal("/migration/sourceConnection")
sourceRdbmsName= grtV.toLua(sourceConn.driver.owner.name)
-- Set target connection
print("Set target connection.")
grtV.setGlobal("/migration/targetConnection", {
name= "targetConn",
_id= grt.newGuid(),
driver= "{8E33CDBA-2B8D-4221-96C4-506D398BC377}",
parameterValues= {
host= "localhost",
jdbcConnStr= "",
password= "#####",
port= "3306",
username= "#####"
},
modules= {
MigrationModule= "MigrationMysql",
ReverseEngineeringModule= "ReverseEngineeringMysqlJdbc",
TransformationModule= "TransformationMysqlJdbc"
}
});
-- set struct and types
*> grtS.set(grtV.getGlobal("/migration/targetConnection"), "db.mgmt.Connection")
grtV.setContentType(grtV.getGlobal("/migration/targetConnection/parameterValues"), "string")
grtV.setContentType(grtV.getGlobal("/migration/targetConnection/modules"), "string")
targetConn= grtV.getGlobal("/migration/targetConnection")
targetRdbmsName= grtV.toLua(targetConn.driver.owner.name)
-- Test connections
print("Test source connection to " .. sourceRdbmsName .. " ...")
res= grtM.callFunction(grtV.toLua(sourceConn.modules.ReverseEngineeringModule), "getVersion", sourceConn)
grt.exitOnError("The connection to the source " .. sourceRdbmsName .. " database could not be established.")
print("Test target connection to " .. targetRdbmsName .. " ...")
res= grtM.callFunction(grtV.toLua(targetConn.modules.ReverseEngineeringModule), "getVersion", targetConn)
grt.exitOnError("The connection to the target " .. targetRdbmsName .. " database could not be established.")
-- store target version for the migration process
grtV.setGlobal("/migration/targetVersion", res)
end
-- ------------------------------------------------------------------
Edited 1 time(s). Last edit at 12/20/2005 02:10PM by stepher r.