Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
suryakant241187
Partner - Contributor III
Partner - Contributor III

Error For Excel ODBC Connection

Hi All,

I am getting the below error while connecting through ODBC:

SQL##f - SqlState: IM002, ErrorCode: 0, ErrorMsg: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

ODBC CONNECT32 TO [Excel Files;DBQ=X:\2. Source data as used for QlikView\1. Employee data\Employee data_31st_March_2018.xlsx]

Below is my Code:

Let vDir = '$(vPathCSP)' & '*.xlsx';

FOR Each file in FileList(vDir)

      ODBC CONNECT32 TO [Excel Files;DBQ=$(file)];

      tables:

      SQLtables;

      DISCONNECT;

NEXT


FOR i = 0 to NoOfRows('tables')-1

      LET sheetName = purgeChar(purgeChar(peek('TABLE_NAME', i, 'tables'), chr(39)), chr(36));

      LET file_path = purgeChar(purgeChar(peek('TABLE_CAT', i, 'tables'), chr(39)), chr(36));

      IF sheetName='Sheet1' THEN

      Employees:               

      LOAD Distinct //Added distinct since the belgium dummy data is not unique, it is made from the training data

      '1' AS IND_EMPLOYEE_DATA,

      [Pers.nr.] AS EMPLOYEE_ID,

        [Pers.nr.] AS ID,         

      [Practice] AS PRACTICE_CODE,

      //[EG],     

      [Aanspreeknaam] AS EMPLOYEE_NAME,

      [Emailadres] as Emailadres,

      [Dat.ID] as joining_date,

      [Grade] as grade

      FROM $(file_path) (ooxml, embedded labels, table is [$(sheetName)]) where IsNum([Pers.nr.]) AND [EG] = 'CSS-P';

      ENDIF

NEXT

DROP Table tables;


Erroe at Line: ODBC CONNECT32 TO [Excel Files;DBQ=$(file)];


Is there any alternate way of code through ODBC to connect  to excel .


Regards,

Suryakant

0 Replies