Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Son of Accused of Violations I'm not committing
Message
From
23/03/2005 13:30:30
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00998499
Message ID:
00998552
Views:
16
Is it possible that you're using record buffering and that the last change has no yet been updated when you move its record pointer?

Alternately, if your "Preview" button is in a toolbar then likely the VALID() of the last field entered isn't being run, in which case it depends on what the last field is.

good luck


something >Wotcha
>
>This is strange. I'm in a print report dialog. I select the records to be printed, and hit preview button, it does some SQL to get the print cursor. Somewhere along the line I get "Uniqueness of Index RteGen is violated". I'm not creating any new records in my source table, merely in the cursor, which has no RI, of course.
>
>Worse still, I put a breakpoint at the 1st line of the code of my Preview button, but I never get there before the error message. Worse even still, the error comes up sometimes when I'm selecting the Route whose details and Stops are to be printed, i.e. on the InteractiveChange() of the combo but, again, despite having a BP in that code I still can't catch it.
>
>Further, it doesn't happen to all my selections, the preview comes up anyway, doesn't always happen on the same record selected again.
>
>The source table Route is the only table in the dialog's DE. Its order is the PK, Route # only, not RteGenDir (which is Route #, generation and direction).
>
>I include all relevant code below but, as I said, the error often happens before the code is met. Any ideas?
>
>'ppreciate it
>
>Terry
>
>Code for Init() of dialog:
>
>LOCAL	lcSafetySet
>
>Set Date BRITISH
>Set Mark to "-"
>mclDialogForm::Init
>
>lcSafetySet	    = SET("SAFETY")
>Set Safety Off
>Set Nulldisplay To ""
>Set Null off
>Select DISTINCT ROUTE.DESC, ROUTE.ROUTE, ROUTE.DIRECTN ;
>  From	    mclMPSer!Route ;
>  Into TABLE csrRouteMin NOFILTER ;
>  Order by   ROUTE.ROUTE, ROUTE.DIRECTN
>	
>Set Safety &lcSafetySet
>With thisform
>  .cboRoute.RowSource = "csrRouteMin.Desc,Route,Directn"
>  .cboRoute.Requery()
>EndWith
>
>Select csrRouteMin
>
>
>Code for IRChange() of combo:
>
>With Thisform
>  .txtRoute.Value	       = this.value
>  .txtRoute.refresh()
>  .cRouteNo	       = this.value
>  .cDirectn	       = this.List( this.ListIndex, 3)	&& Directn is 3rd in list
>  .txtDirectn.value      = .cDirectn
>  .txtDirectn.refresh()
>  .cmdPrint.enabled      = .T.
>  .cmdPreview.enabled    = .T.
>EndWith
>
>
>Code for Click() of Preview button:
>
>With thisform
>  .lmCompileReport()
>  .cmdCancel.caption = "\<Close"
>  .Visible	   = .F.
>  Report Form serRouteIndex Noconsole preview
>  .Visible	   = .T.
>EndWith
>
>
>Code for lmCompileReport():
>
>With thisform
>  Do CASE							&& Compile detail report depending on option
>    Case .cAllOrIndiv = "A"			&& All
>      .cRangeText	= "All Routes, ordered by Route Number?"
>      .lmRptByNumberSQL()
>    Case .cAllOrIndiv = "I"			&& Individual THIS IS THE ONE DONE
>      .cRangeText	= "For Route " + ALLTRIM( .cRouteNo) + "?"   && Appears in header of report
>      .lmRptByRteSQL()
>  EndCASE
>EndWith
>
>
>Code for .lmRptByNumberSQL():
>
>LOCAL	lcSafetySet
>
>lcSafetySet	= SET("SAFETY")
>Set Safety Off
>
>If thisform.lBothDir	&& "O" and "R"  CHECKBOX DETERMINES THIS
>    SELECT Route.route, Route.gen, Route.desc, Route.directn, Route.start_date, ;
>  	 Route.end_date, IIF( Route.freeze, "** Frozen **", SPACE(12)) as Frozen, ;
>	 Rzstop.number as Num, Allzones.zone, Allzones.desc as Zone_Desc, ;
>	 Stop.stop_no, Stop.name as Stop_Desc ;
>    FROM mclmpser!route ;
>	 LEFT OUTER JOIN mclmpser!RzStop ;
>	   ON  Route.Route 	== RzStop.Rte_No ;
>	   and Route.Gen		== RzStop.Rte_Let ;
>	   and Route.Directn	== RzStop.Directn ;
>	 LEFT OUTER JOIN mclmpstop!stop ;
>	   ON ALLTRIM( Rzstop.stop)	== ALLTRIM( Stop.stop_no) ;
>	 LEFT OUTER JOIN mclMPFac!AllZones ;
>	   ON Rzstop.zone 		== Allzones.zone ;
>   INTO CURSOR csrRouteIndex NOFILTER ;
>   WHERE Route.Route		== thisform.cRouteNo ;
>   ORDER BY Route.Route, Route.gen, Route.directn, Rzstop.number
>Else						&& "O" or "R" selected as thisform.cDirection
>   && N/A
>Endif
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform