Importing MS Access Data

mike-h30 wrote on Thursday, January 24, 2008:

I am in the process of moving openEMR2.8.3 to production.  I am trying to import data from an MS Access EMR ( Amazing Charts).  I exported the data from one of the Access tables into a text file.  When trying to import that text file from PhpMyAdmin (2.5.5-pl1) into the MySQL database of OpenEMR, I received the following error:

Database openemr  - Table patient_data  running on localhost

Error

SQL-query :

LOAD DATA LOCAL INFILE ‘/tmp/phpcWNZOD’ INTO TABLE `patient_data` FIELDS TERMINATED BY ‘;’ ENCLOSED BY ‘"’ ESCAPED BY ‘\’ LINES TERMINATED BY ‘\n’

MySQL said:
#1148 - The used command is not allowed with this MySQL version

Can someone tell me how to import my Access EMR data into OpenEMR? Here are the stats from the home page of PhpMyAdmin in the OpenEMR database administration. 

Welcome to phpMyAdmin 2.5.5-pl1

MySQL 5.0.26 running on localhost as openemr@localhost

Thanks.

-Mike

andres_paglayan wrote on Thursday, January 24, 2008:

are you using phpmyadmin?
if not, I will strongly recommend you use that,
or other GUI to deal with the DB,
that will help with the syntax,
which btw, i guess is load data infile  if local is not enabled in your mysql compilation,
so phpmyadmin can bypass that limitation if that’s the problem,

mike-h30 wrote on Thursday, January 24, 2008:

Hi Andres,

Yes, I was using PHP MyAdmin 2.5.5-pl1 in the administration section of OpenEMR. My current version of MySQl is 5.0.26.  That is how the error was generated.  Is there perhaps a compatibility issue with PHP MyAdmin 2.5.5-pl1 and MySQL 5.0?

Thanks.

-Mike

andres_paglayan wrote on Thursday, January 24, 2008:

not a clue about that, but if you use the 2.11,
that will be compatible with mysql 5 for sure

mike-h30 wrote on Saturday, January 26, 2008:

I found a GUI tool called Navicat 8 that I am using to load a text file ( data from Microsoft Access table) into the patient_data table.    I keep getting the following error:

Error 1062 Duplicate entry ‘0’ for key 1

I do not understand the nature of this error as I do not have any duplicate keys in my text file.  I have reduced my text file to
2 records for debugging - 1 for the header and the second for the first row of data.  I have made sure to set my insert parameters to the second row of the text file to avoid inserting the header info.  Has anyone encountered this error before?

andres_paglayan wrote on Saturday, January 26, 2008:

the mysql table is expecting a "unique" key,
and receiving either, a duplicate or second record with null for id
check that the field is auto_increment

mike-h30 wrote on Saturday, January 26, 2008:

Thanks Andres.  I noticed that the two unique keys are patient_data.pid and patient_data.pubpid.  At least when I populated these two fields with the key from my text file "Patient_ID" I was able to successfully import the data.