Foxpro query returning Zero Rows [Answered]RSS

2 replies

Last post Jan 15, 2012 09:38 PM by Lloydz

  • Foxpro query returning Zero Rows

    Jan 11, 2012 01:07 PM|ojm37|LINK

    I have IIS 7.5 running on Windows Server 2008 R2 (also happens in IIS 7.5 running on Windows 7 Ultimate).  I have a portion of my site that is running a Foxpro database (don't ask!) in classic asp.  Some of this works fine (in fact most of it).  However, I have one set of queries that always returns ZERO rows when run from the asp (a copy and paste of the command text into the Foxpro 9 IDE returns the expected data). (The queries run fine and return the expected rows when run under IIS6 on Windows Server 2003).

    Any ideas?

    The SQL (and database) were written LONG-LONG-AGO-IN-A-GALAXY-FAR-FAR-AWAY.... Here's an example of the query that is returning zero rows from ASP, but the correct data from the Foxpro IDE:

    Select Top 21 empty(Script) as IsNoScript, UID, History as InfoCol, chrtran(ExamType,'/',' ') as examtype, Trim(ACRANAT) as ACRCode, Diagnosis, DtoC(ModDate) as cModDate, DtoC(CrDate) as cCRDate, (Date() - CRDate) as DaysOld From TF Where (UID<='~' .AND. !'NRT' $ CASEFLAGS) .AND. (ACRAnat LIKE "4%") order by UID DESCENDING

    Foxpro

    Owen
  • Re: Foxpro query returning Zero Rows

    Jan 11, 2012 04:28 PM|ojm37|LINK

    OK.  If I change the WHERE clause of the query to

    WHERE (UID<>'~' .AND.

    Then I get rows.  Any idea why someone would start out a foxpro query with [some_column]<'~'  (where some_column is a character(10) type column)?

    TIA,

    Owen
  • Re: Foxpro query returning Zero Rows

    Jan 15, 2012 09:38 PM|Lloydz|LINK

    Hi,

    Since it returns expected data in IDE, it is most probably that the query content is not properly set due to some other issue(e.g encoding). Is your query set in code dynamically? If it is, I suggest you use Response.Write to write the query content in page so that we could determine whether it is the issue with incorrect query content.

    Thanks.