<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ODBC Connection to csv issue in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/ODBC-Connection-to-csv-issue/m-p/1826644#M1214023</link>
    <description>&lt;P&gt;Hello, I am trying to make an Odbc connection to a series of * .csv files,&lt;BR /&gt;to load their content in a table, but I receive a series of errors,&lt;BR /&gt;I would appreciate any contribution to solve it. Attached the errors and part of the code,&lt;BR /&gt;Thank you very much in advance.&lt;/P&gt;&lt;P&gt;The code is this:&lt;/P&gt;&lt;P&gt;FOR EACH File in FileList('*.CSV');&lt;/P&gt;&lt;P&gt;ODBC CONNECT32 TO [Csv FilesOk;DBQ=$(File)];&lt;BR /&gt;&lt;BR /&gt;tables:&lt;BR /&gt;SQLtables;&lt;BR /&gt;&lt;BR /&gt;DISCONNECT;&lt;BR /&gt;&lt;BR /&gt;Let count = SubStringCount(File,'\');&lt;BR /&gt;Let tablename = left(Subfield(File,'\',$(count)+1),len(Subfield(File,'\',$(count)+1))-5);&lt;BR /&gt;&lt;BR /&gt;FOR i = 0 to NoOfRows('tables')-1&lt;BR /&gt;&lt;BR /&gt;LET sheetName = purgeChar(purgeChar(peek('TABLE_NAME', i, 'tables'), chr(39)), chr(36));&lt;BR /&gt;&lt;BR /&gt;if(Exists(TableName($(sheetName)))) then&lt;BR /&gt;&lt;BR /&gt;Concatenate&lt;BR /&gt;'$(tablename)':&lt;BR /&gt;Load *&lt;BR /&gt;From $(File)(ooxml, embedded labels, table is [$(sheetName)]);&lt;BR /&gt;&lt;BR /&gt;ELSE&lt;BR /&gt;&lt;BR /&gt;NoConcatenate&lt;BR /&gt;'$(tablename)':&lt;BR /&gt;Load *&lt;BR /&gt;From $(File)(ooxml, embedded labels, table is [$(sheetName)]);&lt;BR /&gt;&lt;BR /&gt;ENDIF&lt;/P&gt;&lt;P&gt;NEXT i;&lt;/P&gt;&lt;P&gt;Drop table tables;&lt;/P&gt;&lt;P&gt;Next File;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Aug 2021 14:23:25 GMT</pubDate>
    <dc:creator>Fernan</dc:creator>
    <dc:date>2021-08-04T14:23:25Z</dc:date>
    <item>
      <title>ODBC Connection to csv issue</title>
      <link>https://community.qlik.com/t5/QlikView/ODBC-Connection-to-csv-issue/m-p/1826644#M1214023</link>
      <description>&lt;P&gt;Hello, I am trying to make an Odbc connection to a series of * .csv files,&lt;BR /&gt;to load their content in a table, but I receive a series of errors,&lt;BR /&gt;I would appreciate any contribution to solve it. Attached the errors and part of the code,&lt;BR /&gt;Thank you very much in advance.&lt;/P&gt;&lt;P&gt;The code is this:&lt;/P&gt;&lt;P&gt;FOR EACH File in FileList('*.CSV');&lt;/P&gt;&lt;P&gt;ODBC CONNECT32 TO [Csv FilesOk;DBQ=$(File)];&lt;BR /&gt;&lt;BR /&gt;tables:&lt;BR /&gt;SQLtables;&lt;BR /&gt;&lt;BR /&gt;DISCONNECT;&lt;BR /&gt;&lt;BR /&gt;Let count = SubStringCount(File,'\');&lt;BR /&gt;Let tablename = left(Subfield(File,'\',$(count)+1),len(Subfield(File,'\',$(count)+1))-5);&lt;BR /&gt;&lt;BR /&gt;FOR i = 0 to NoOfRows('tables')-1&lt;BR /&gt;&lt;BR /&gt;LET sheetName = purgeChar(purgeChar(peek('TABLE_NAME', i, 'tables'), chr(39)), chr(36));&lt;BR /&gt;&lt;BR /&gt;if(Exists(TableName($(sheetName)))) then&lt;BR /&gt;&lt;BR /&gt;Concatenate&lt;BR /&gt;'$(tablename)':&lt;BR /&gt;Load *&lt;BR /&gt;From $(File)(ooxml, embedded labels, table is [$(sheetName)]);&lt;BR /&gt;&lt;BR /&gt;ELSE&lt;BR /&gt;&lt;BR /&gt;NoConcatenate&lt;BR /&gt;'$(tablename)':&lt;BR /&gt;Load *&lt;BR /&gt;From $(File)(ooxml, embedded labels, table is [$(sheetName)]);&lt;BR /&gt;&lt;BR /&gt;ENDIF&lt;/P&gt;&lt;P&gt;NEXT i;&lt;/P&gt;&lt;P&gt;Drop table tables;&lt;/P&gt;&lt;P&gt;Next File;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 14:23:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ODBC-Connection-to-csv-issue/m-p/1826644#M1214023</guid>
      <dc:creator>Fernan</dc:creator>
      <dc:date>2021-08-04T14:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: ODBC Connection to csv issue</title>
      <link>https://community.qlik.com/t5/QlikView/ODBC-Connection-to-csv-issue/m-p/1826724#M1214027</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SET ErrorMode=0;
FOR EACH File in FileList('*.csv');
ODBC CONNECT32 TO [Excel Files;DBQ=$(File)]; 

tables:
SQLtables;
DISCONNECT;
Let count = SubStringCount(File,'\');
Let tablename = 'Table '&amp;amp; left(Subfield(File,'\',$(count)+1),len(Subfield(File,'\',$(count)+1))-4);
FOR i = 0 to NoOfRows('tables')-1
LET sheetName = purgeChar(purgeChar(peek('TABLE_NAME', i, 'tables'), chr(39)), chr(36));

NoConcatenate
'$(tablename)':
Load *
From $(File)(txt, codepage is 28591, embedded labels, delimiter is ';', msq);

NEXT i;
Drop table tables;
Next File;&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 04 Aug 2021 19:24:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ODBC-Connection-to-csv-issue/m-p/1826724#M1214027</guid>
      <dc:creator>Frank_Hartmann</dc:creator>
      <dc:date>2021-08-04T19:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: ODBC Connection to csv issue</title>
      <link>https://community.qlik.com/t5/QlikView/ODBC-Connection-to-csv-issue/m-p/1826732#M1214028</link>
      <description>&lt;P&gt;Hi Frank, I have tried several .csv files but it keeps giving me an error.&lt;BR /&gt;I am attaching a screenshot and the message it gives me.&lt;/P&gt;&lt;P&gt;Thank you very much in advance.&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-08-04 22_06_25-Screenshot-1.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/59715i1759B97C13F76CBD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2021-08-04 22_06_25-Screenshot-1.png" alt="2021-08-04 22_06_25-Screenshot-1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Connecting to Excel Files;DBQ=C:\Fenix\Modelo de Datos\KPIS\Nuevosdatos\tablita.csv;&lt;BR /&gt;Failed to connect&lt;BR /&gt;Connector connect error: SQL##f - SqlState: S1000, ErrorCode: 4294962281, ErrorMsg: [Microsoft][Controlador ODBC Excel] La tabla externa no tiene el formato esperado.&lt;BR /&gt;ODBC CONNECT32 TO ***&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 20:11:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/ODBC-Connection-to-csv-issue/m-p/1826732#M1214028</guid>
      <dc:creator>Fernan</dc:creator>
      <dc:date>2021-08-04T20:11:55Z</dc:date>
    </item>
  </channel>
</rss>

