ok, there's progress thanks to you. I'm using ODBC. Quoting field names does work indeed.

There still remain one problem; the query returns only a handfull of rows instead of the 2000 expected. Which brings me back to this 'illegal character' thing I was refering to in my first post.

As the data fetching occurs, something must go wrong somewhere and stop the process. I'll have to identify the offending column.

Can you explain why trying to order the result set fails?

$query = $dbh->column_info('','',$table,''); $column_info = $query->fetchall_arrayref(); for $i ( 0 .. $#{$column_info} ) { $fields .= qq| "$column_info->[$i][3]",| } chop $fields; $sql = qq|SELECT $fields FROM $table ORDER BY "REF"|; $query = $dbh->prepare($sql) or die "could not prepare $sql : $DBI::er +rstr\n"; $query->execute or die "could not execute $sql : $DBI::errstr\n"; $result = $query->fetchall_arrayref();

This returns nothing. And does not produce any error neither.

H

In reply to Re^2: Fetching data from Access using DBI by hacheb
in thread Fetching data from Access using DBI by hacheb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.