Re: PHP ODBC and Pervasive.SQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robert,

Thank you very much for your post: odbtp solved the problem and gave me a
head start on moving the site to a Linux box.

Pascal

"Robert Twitty" <rtwitty@xxxxxxxxxxxxxxxxx> wrote in message
news:Pine.GSO.4.44.0402261348200.12562-100000@xxxxxxxxxx
> Hi Pascal
>
> The odbc extension uses ODBC 2, while Access and Pervasive are most likely
> using ODBC 3.  This may or may not be the cause of your problem. Try using
> the odbtp extension at http://odbtp.sourceforge.net. It uses ODBC 3, and
> may give you better results.
>
> -- bob
>
> On Wed, 25 Feb 2004, Pascal Schaedeli wrote:
>
> > Hi,
> >
> > I am executing a SELECT query from PHP (4.3.4) through ODBC on a
Pervasive
> > 2000SP4 (all on Windows). odbc_result_all, odbc_fetch_into, and all
other
> > php odbc function stop returning records before the end of the effective
> > resultset.
> >
> > Here is what is happening  :
> > * In Pervasive: SELECT * FROM table returns n records (correct).
> > * In Access, throught ODBC, the same query returns the same n records
> > (correct).
> > * In PHP, odbc_exec of the same query returns m<n records.
> >
> > Specifically, I have identifed one field (call it fieldx) that seems to
be
> > at the source of the problem : it seems stored over 4 bytes in Pervasive
and
> > represents a decimal number.
> > If I rewrite the query in PHP to read SELECT fielda, fieldb,fieldc FROM
> > table, it returns n records (correct) (just to clarify SELECT fielda,
> > fieldb,fieldc,fieldx FROM table returns m<n records).
> >
> > How many is m? It depends on the sort order. I have identified with
record's
> > fieldx is causing the problem. The records returned by odbc_* are up to
that
> > problem record. If the sort order makes that problem record to be the
last
> > one, then m = n-1. If the sort order makes that record be the first,
then m
> > = 0.
> >
> > Here is even more details for those who are still reading:
> > fieldx is written to Pervasive from an application for which I do not
have
> > the source code. If I read the content of fieldx of the problem records,
> > erase it and manually re-enter it (in Pervasive Control Center), the
issue
> > is solved and the PHP odbc query returns n records.
> >
> > I'm not an expert on odbc and pervasive. Intuitively, it seems that the
> > field is somehow missformated. However, both Pervasive and Access are
able
> > to interpret it correctly.
> >
> > Does anybody have a suggestion on how I could either:
> > - Get Pervasive to reformat all field correctly.
> > - Get the odbc library in PHP to at least give me an error, or better,
> > interpret the field as Access does.
> >
> > Thanks,
> > Pascal
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux