Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bizarre crashing problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00281059
Message ID:
00281192
Vues:
20
Hi Michelle,

2 ideas:
As I've never used the "SUM" command before, have you tried replacing it with SQL? i.e.
SELECT SUM(Amount) AS Sum_Amt FROM Argltr ;
   WHERE (LEFT(glcode,1) $ "DGN") ;
   AND (BETWEEN(invdate,pdBegin,pdEnd)) ;
   INTO CURSOR csrTtl
lnAmount = csrTtl.Sum_Amt
use in csrTtl
Also, are you printing to an HP Laserjet? As I recall, there were crashes with the PCL 5? driver. When I switched to the PostScript driver that eliminated many of my crashes.

BTW, I had to read that iif() a few times before I caught it, too. <BG>

HTH,
>I have this code:
>
>
>SELECT Argltr
>SUM amount TO lnAmount FOR (LEFT(glcode,1) $ "DGN") AND (BETWEEN(invdate,pdBegin,pdEnd))
>
>SELECT "X" AS metal, company, amount, netwgt, IIF(netwgt=0,000.00,ROUND(MTON(amount)/netwgt,2)) AS priceper, ;
>       IIF(lnAmount=0,000.00,ROUND((MTON(amount)/lnAmount)*100,2)) AS percsale ;
>FROM argltr  ;
>INTO CURSOR ccstc ;
>WHERE (LEFT(glcode,1) $ "DGN") AND (BETWEEN(invdate,pdBegin,pdEnd)) ;
>ORDER BY amount DESC
>
>pcTitle = "TORRANCE CASTING INC."+CHR(10)+ ;
>          "CORP. SALES TO CUSTOMER"+CHR(10)+ ;
>          "BY SALES $$"+CHR(10)+ ;
>          "FOR "+DTOC(pdBegin)+" THRU "+DTOC(pdEnd)
>
>REPORT FORM (gc_adrvprg+"ccstc") TO PRINTER PREVIEW
>
>
>When I run it the first time, it runs fine. But if I run it again, it crashes on the SQL SELECT. If I comment out the report call, I can run it over and over with no problems. But as soon as that report runs, the next time it hits the SQL, it crashes. By crashes, I mean crashes VFP.
>
>I don't have a clue what could be wrong. Any ideas?
>
>Thanks,
>
>Michelle
Bill Armbrecht
VFP MCP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform