Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Losing alias to an open table?
Message
From
13/07/2006 11:41:06
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Losing alias to an open table?
Miscellaneous
Thread ID:
01136049
Message ID:
01136049
Views:
54
I have a case where it appears that an alias for an open table is being 'lost'.
The snippet of code follows:
SELECT DISTINCT MAX(FileSeqNo), FileDoctor, fileYrMth  ;
    FROM ohDisk  ;            && found here   <------------------------
    WHERE FileYrMth = .cThisDiskYr + .cThisDiskMth AND FileGroup = "0000"  ;
	  AND FileDoctor IN ( SELECT DISTINCT exDoctor FROM ForOhip WHERE NOT EMPTY(exiniPK) )  ;
    ORDER BY FileDoctor  ;
    GROUP BY FileDoctor, FileYrMth  ;
    INTO ARRAY aDocsToBeCopied
IF _Tally > 0
    SELECT ohDisk			&& just for debugging...found here   <-----------------
    FOR m.xx = 1 TO ALEN(aDocsToBeCopied, 1)
	USE (m.StoreDir + "\" + aDocsToBeCopied[m.xx, cDocYrMth] + aDocsToBeCopied[m.xx, cDocID]  ;
			+ PADL(ALLTRIM(STR(aDocsToBeCopied[m.xx, cDocSeq], 3, 0)), 3, '0') + ".dbf") ALIAS ToAppendTo
	SELECT ToAppendTo
	APPEND FROM DBF("ForOHIP") FOR exDoctor = aDocsToBeCopied[m.xx, cDocID]
	SELECT ForOhip
	COUNT TO m.yy FOR exDoctor = aDocsToBeCopied[m.xx, cDocID] AND OHIPclmRec = "HET"
	SELECT ohDisk           && Get alias not found here <=========================
	LOCATE FOR FileYrMth = aDocsToBeCopied[m.xx, cDocYrMth] AND FileGroup = "0000"  ;
				  AND FileDoctor = aDocsToBeCopied[m.xx, cDocID] AND FileSeqNo = aDocsToBeCopied[m.xx, cDocSeq]
	IF FOUND("ohDisk")
	    REPLACE IN ohDisk ItemsClmd WITH ItemsClmd + m.yy
	ELSE 
	    WAIT WINDOW "Control file record not found for " + aDocsToBeCopied[m.xx, cDocYrMth] ;
			+ aDocsToBeCopied[m.xx, cDocID] + ALLTRIM(VAL(aDocsToBeCopied[m.xx, cDocSeq]))
	USE IN ToAppendTo
	ENDIF 
    NEXT m.xx
ELSE 

ENDIF 	
Any idea what's causing the problem?

Thanks
Next
Reply
Map
View

Click here to load this message in the networking platform