Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG? Incorrect Table using SELECT
Message
De
13/05/1999 01:06:23
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00217992
Message ID:
00218246
Vues:
22
>I had not experienced this one before. I recently wrote code into my Class Library Reporting form to issue the _FPRESET and clear the TAG and TAG2 fields. What I did was the following:
>
>*******Code Snippet*******
>
>SELECT * FROM (some report.frx file) INTO TABLE (lcTemp)
>SELECT (lcTemp)
>BLANK FIELDS TAG,TAG2
>lnWorkArea = SELECT()
>lcReportFileName = DBF()
>USE IN (lnWorkArea)
>REPORT FORM &lcReportFileName TO PRINTER PROMPT
>
>****** End of Snippet ******
>
>Now what happened was that the report file itself had the following code in it. Remember we are now printing the Report from the Temporary Table that we created. But something very odd is about to happen.
>
>You might call this the FRX-Files! :-)
>
>IF !USED("SomeTable")
> USE "SomeTable" IN 0 AGAIN
>ENDIF
>SELECT SomeTable
>SELECT RefNum,Field1,Field2 FROM SomeTable WHERE SomeCritera INTO ;
> CURSOR cSomeCursor
>
>Here I would get an error and it would say REFNUM Not Found!
>
>Very Odd! So I Stepped through the code and I added a browse in there and when it would say SELECT SomeTable and then BROWSE it brought up the REPORT.FRX table up instead of the correct alias.
>
>I have since fixed the problem by issuing a USE IN (lnWorkarea) for both the SELECT (SomeReportFile) and the Temporary Table created from the SELECT.
>
>I just thought this was very odd! It was as if the Work Areas were getting confused.
Rich,
It's not odd if report.frx has same alias as the table itself (if !used(..)...).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform