Using DATAMGR to transfer data between different DBMS's

I had data in an MSACCESS database and I needed the same data in a MYSQL database of the same structure.

Easy enough to do but rather tedious to find out the little syntax differences and to code the insert statements.

So I used datamgr.

Datamgr is a database abstraction tool with a nice straight forward set of functions. Details can be found here

Here is the code I used which made the task very easy in just a few lines of code. All the query syntax and column names are left to datamgr.


<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>
javacast("null","")
<cfset var result = getProfileString(inifile,name,key)>
javacast("null","")
<cfset var result = getProfileString(inifile,name,key)>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>
<!--- Clear any data in the target table --->
    <cfquery name="clear#thistable#" datasource="mydb_mysql">
     delete from #thistable#
    </cfquery>
    <cfloop from="1" to="#arraylen(arraydata)#" index="i">
separate each row of data as a structure
     <cfset mydata = arraydata[#i#]>
<!--- use datamgr to insert the row of data into mysql --->
     <cfset myprimekey=dmmysql.insertrecord(thistable,mydata)>
    </cfloop>
</cfloop>

<!--- Create datamrg objects for each datasource --->
<cfset dmaccess = createobject("component","datamgr.DataMgr_Access").init("mydb_access")>
<cfset dmmysql = createobject("component","datamgr.DataMgr_MYSQL").init("mydb_mysql")>
<!--- Include a udf to convert a query to a structure --->
<cfinclude template="querytostruct.cfm">
<!--- Specify a list of tables to be converted --->
<cfset tablelist = "contact,address,country,order,orderline,product,price">
<cfloop list="#tablelist#" index="thistable">
<!--- Initialise datamgr for the table in question for both datasources --->
<cfset dmaccess.LoadTable(thistable)>
<cfset dmmysql.LoadTable(thistable)>
<cfoutput>#thistable#</cfoutput><br/>
<!--- Read all records in the table from the msaccess datasource --->
    <cfset qmydata = dmaccess.getRecords(thistable)>
<!--- turn query into a array of structures --->
    <cfset arraydata = querytostruct(qmydata)>