Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
vchuprina
New Contributor II

ODBC connection issue

Hi Guys,

I start working at new computer and have an issue with OBDC connection.

When I load files I get following issue "External table is not in the expected format".

Usually I use following code to make connection:

For Each vFile in FileList('$(vPath)\*xlsx')

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

   // Read list of sheets

  Temp_Tables:

  sqltables;

Also I installed ODBC driver from microsoft site, but problem still exist.

How can I solve this problem

7 Replies
MVP
MVP

Re: ODBC connection issue

Are you sure that all the XLSX-files really are in XLSX-format? There could be corrupt files you know. Have you checked if this error message comes up with any or all of files?

MVP
MVP

Re: ODBC connection issue

I assume you also created a User or System DSN using the ODBC Administrator (Edit script -> Tools -> ODBC Administrator xx Bit)?

vchuprina
New Contributor II

Re: ODBC connection issue

Hi Petter,

I know such issue, so I check files and can confirm that all files are in xlsx format 

vchuprina
New Contributor II

Re: ODBC connection issue

Yes, I created DSN.

joaquinlr
Valued Contributor II

Re: ODBC connection issue

Hi VChuprina:

I don't use ODBC for importing excel files

XLS_File:

LOAD *

FROM

$(vDir)MyFile.xlsx

(ooxml, embedded labels);

Hope it helps,

Joaquín

MVP
MVP

Re: ODBC connection issue

You haven't got a period between filename and extension, could that create a problem for you?

          For Each vFile in FileList('$(vPath)\*xlsx')


Should be


     For Each vFile in FileList('$(vPath)\*.xlsx')

Re: ODBC connection issue

It may help to add a trace command on $(vFile) so you can see what file is being processed in the logfile.

For Each vFile in FileList('$(vPath)\*.xlsx')

trace  ......Processing $(vFile) ;

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

   // Read list of sheets

  Temp_Tables:

  sqltables;

Community Browser