>close data all >SET ESCAPE ON >SET EXCLUSIVE OFF >SET REPROCESS TO 5 >SET TABLEVALIDATE TO 3 >IF MESSAGEBOX("Server?",4+32+0)=6 > ** this is the 1st Vista computer > ** create c:\ice folder and share it before running this program > SET DEFAULT TO c:\ice > > IF MESSAGEBOX("Create database?",4+32+256)=6 > CREATE DATABASE 'ICE.DBC' > > ***** Table setup for ICETABLE ***** > CREATE TABLE 'ICETABLE.DBF' NAME 'ICETABLE' (; > PK I NOT NULL, ; > SOURCE C(10) NOT NULL, ; > SOURCENUM I NOT NULL, ; > DATE_TIME T NOT NULL) > > ***** Create each index for ICETABLE ***** > SET COLLATE TO 'GENERAL' > ALTER TABLE 'ICETABLE' ADD PRIMARY KEY PK TAG PK > INDEX ON SOURCE TAG SOURCE > INDEX ON SOURCENUM TAG SOURCENUM > INDEX ON SOURCE+STR(SOURCENUM) TAG SOSO > > ***** Table setup for ICENUMS ***** > CREATE TABLE 'ICENUMS.DBF' NAME 'ICENUMS' (; > TABLENAME C(30) NOT NULL, ; > FIELDNAME C(30) NOT NULL, ; > FIELDVALUE I NOT NULL) > > INSERT INTO icenums (tablename, fieldname, fieldvalue) ; > VALUES ("icetable","pk",1) > > ENDIF >ELSE > ** this is the 2nd Vista computer > SET DEFAULT TO \\vista1\ice >ENDIF > > >LOCAL lnPK,lnX,lnLoops,lcSource,lnSourceNum >DO WHILE .T. > close data all > TRY > OPEN DATABASE ice SHARED > USE icenums SHARED IN 0 > USE icetable SHARED IN 0 > CATCH > ** oh well > ENDTRY > IF USED('icetable') > lnLoops=INT(RAND()*200) > lcSource=SYS(2015) > lnSourceNum=INT(RAND()*5000) > llRollBack=.F. > > BEGIN TRANSACTION > > FOR lnX=1 TO lnLoops > SELECT icenums > LOCATE FOR tablename="icetable" AND fieldname="pk" > IF FOUND() > IF LOCK() > lnPK=icenums.fieldvalue > replace icenums.fieldvalue WITH lnPK+1 > > INSERT INTO icetable ; > (pk,source,sourcenum,date_time) ; > VALUES ; > (lnPK,lcSource,lnSourceNum,DATETIME()) > ENDIF > ENDIF > ENDFOR > > ** rollback every once in a while > IF INT(RAND()*5)=4 > ? 'rolled back'+TTOC(DATETIME()) > ROLLBACK > ELSE > ? 'committed '+TTOC(DATETIME()) > END TRANSACTION > ENDIF > > UNLOCK ALL > ENDIF > > WAIT WINDOW 'waiting .1 second' TIMEOUT .1 >ENDDO > >close data all >I don't even know what SMB2 is but suspect this is only an early example of VFP, in its discontinued state, falling out of step with advancing OS releases. They sure aren't going to hold back Windows features for the sake of FoxPro compatibility.