Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anil Sharma
  Where is Anil Sharma?
 ludhiana
 India
 Anil Sharma
 To: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 Tags
Subject: RE: Duplicate Bill No.
Thread ID: 209644 Message ID: 209655 # Views: 49 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Windows Vista and VFP
Date: Tuesday, December 30, 2008 9:44:08 AM         
   


> >
> > Anup Better to make a another table which will store the last billno.
> > create a table lets say NumTable. Which have the following Structure
> > CREATE TABLE NumTable (BillBookID I,BillNo I)
> > Let says our bill book ID No. is 1
> > INSERT INTO NUMTABLE (1,0)
> >
> > Now in your program where u want to get the new bill no. try this
> > Local lnMaxBillNo
> > lnMaxBillNo =0
> > SELECT NUMTABLE
> > =SEEK(LocalVariableForBillBookID,'NUMTABLE','BillBookID')
> > IF FOUND() AND RLOCK()
> > REPLACE NUMTABLE.BillNo with NUMTABLE.BillNo + 1
> > FLUSH
> > lnMaxBillNo = NUMTABLE.BillNo
> > UNLOCK ALL
> > ENDIF
> >
> > =MESSAGEBOX(lnMaxBillNo) && Here is your unique Bill No.
> >
> > This Logic is blazing fast on network and will table fraction of second to update!.
> >
> > Anil
> > My Blog
>
> I would put the RLOCK in a loop
>
>
IF FOUND()
>    DO WHILE NOT RLOCK()
>    ENDDO
> ENDIF
> 

>
> Regards
> Tushar

Yeh much better! what about SET REPROCESS TO -1 :)

Anil
My Blog

ENTIRE THREAD

Duplicate Bill No. Posted by Anup Singh @ 12/30/2008 8:34:42 AM
RE: Duplicate Bill No. Posted by mike castillo @ 12/30/2008 8:57:00 AM
RE: Duplicate Bill No. Posted by tushar @ 12/30/2008 9:08:55 AM
RE: Duplicate Bill No. Posted by Anil Sharma @ 12/30/2008 9:15:14 AM
RE: Duplicate Bill No. Posted by tushar @ 12/30/2008 9:34:36 AM
RE: Duplicate Bill No. Posted by Anil Sharma @ 12/30/2008 9:44:08 AM
RE: Duplicate Bill No. Posted by tushar @ 12/30/2008 2:29:07 PM
RE: Duplicate Bill No. Posted by mike castillo @ 12/31/2008 2:31:15 AM
RE: Duplicate Bill No. Posted by tushar @ 12/31/2008 6:04:54 AM
RE: Duplicate Bill No. Posted by Anders Altberg @ 12/31/2008 12:37:54 PM
RE: Duplicate Bill No. Posted by Anil Sharma @ 1/2/2009 9:06:24 AM
RE: Duplicate Bill No. Posted by Anders Altberg @ 1/2/2009 11:40:02 AM
RE: Duplicate Bill No. Posted by Anup Singh @ 1/2/2009 9:46:35 AM
RE: Duplicate Bill No. Posted by Jag Pal Sharma @ 2/2/2016 12:32:58 PM
RE: Duplicate Bill No. Posted by Tore Bleken @ 2/2/2016 12:48:00 PM
RE: Duplicate Bill No. Posted by Anders Altberg @ 1/2/2009 2:18:18 PM
RE: Duplicate Bill No. Posted by Anil Sharma @ 1/3/2009 7:58:04 AM
RE: Duplicate Bill No. Posted by anand kulkarni @ 2/4/2016 8:28:08 AM
RE: Duplicate Bill No. Posted by Tore Bleken @ 2/4/2016 8:58:38 AM
RE: Duplicate Bill No. Posted by anand kulkarni @ 2/4/2016 10:49:02 AM