Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is this a VFP Bug
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Is this a VFP Bug
Miscellaneous
Thread ID:
01335548
Message ID:
01335548
Views:
46
Hi Friends,

Kindly check this code, the records are getting duplicated.
IF !DIRECTORY( 'C:\DELME')
   MD C:\DELME
ENDIF
CREATE TABLE C:\DELME\X1 (F01 C(5))
FOR lnCnt = 1 TO 10000
   INSERT INTO X1 (F01) VALUES (SPACE(5))
ENDFOR
REPLACE ALL F01 WITH TRANSFORM( RECNO())
USE IN X1
 
lcCS = [Driver=Microsoft Visual Foxpro Driver;SourceDB=C:\DELME\;SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;]
lnH = SQLSTRINGCONNECT( lcCS)
 
LOCAL lcSQL
lcSQL = [ SELECT F01 FROM C:\X1]
?SQLE( lnH , lcSQL, '_cT1')
?SQLDISCONNECT( lnH)
 
SELECT '1', CNT(*),F01 FROM _CT1 GROUP BY 3 ORDER BY 1 DESC HAVING CNT(F01)>1 INTO CURSOR _cT1X
BROW
After you try this code couple of time you would realize _cT1 is having duplicated records, Any ideas why this is happening.
This only happens when using ODBC

Thanks
--
--
Aashish Sharma
Tele Nos: +1-201-490-5405
Mobile: +91-9821053938
E-Mail:
aashish@aashishsharma.com
write2aashish@gmail.com

You better believe in yourself... if you don't, who else will ?
TODAY is a gift, that's why it's called PRESENT
Next
Reply
Map
View

Click here to load this message in the networking platform