One Star

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open

Hello,
I'am new in Talend and I have a problem to integrate Talend generate java code in my program (IDE : netbeans).
I have two files : a excel file and a access file. I want to insert the path of this file in parameters.
My code is :
   
public static void importData (String excelPath, String accessPath){
String [] context = {"--context_param ExcelPath=C:/Users/Nat/Desktop/Template.xlsx","--context_param AccessPath=C:/Users/Nat/Desktop/DB.accdb"};
ImportExcelToAccessSimpleTemplate.main(context);
}

This line provide me the following exception : java.sql.SQLException: General error Unable to open registry key Temporary (volatile) Ace DSN
If I remove context-param to my talend job and write path directly on my tAccessConnection etc, it works...
Someone have an idea to solve this issue ?
Thanks,
Best regards,
2 REPLIES
One Star

Re: [Microsoft][ODBC Microsoft Access Driver]General error Unable to open

I have find the solution :
    public static void main(String[] args) {
String [] context = {"--context=Default","--context_param ExcelPath=C:/Users/Nat/Desktop/Template.xlsx","--context_param AccessPath=C:/Users/Nat/Desktop/DB.accdb"};
ImportExcelToAccessSimpleTemplate.main(context);
}

I have inserted file Default.properties in netbeans :-)
One Star

Re: [Microsoft][ODBC Microsoft Access Driver]General error Unable to open

Hi
Great! Glad to see you have fixed it!
Regards,
Pedro