Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete a record from Four dbf's
Message
From
07/01/2005 08:58:10
 
 
To
07/01/2005 08:40:42
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00975043
Message ID:
00975051
Views:
15
Hi Tariq,

first of all, if you regularly need to pack your tables, I suggest you reconsider your design. In a good design, pack is only for maintainance, and should happen maybe once or twice a year.

So for your problem. Do you have fields in your tables with similar names as your memvars? Try the 'm.dot' test:
SELECT FIXBOOK
SCATTER MEMVAR
ACC_CODE2 = m.ACC_CODE
CODE2 = m.ACC_CODE
DATE1 = m.FIX_DATE
VOU_NO2 = m.VOU_NO
VOU_NO1=THISFORM.TEXT12.VALUE

DELETE FOR BILL_NO=m.VOU_NO1
PACK

SELECT VOUCHERS
DELETE FOR VOU_NO=m.VOU_NO2 .AND. VOU_TYPE='PR' .AND. DATE=m.DATE1
PACK

SELECT VOU_SUM
DELETE FOR VOU_NO=m.VOU_NO2 .AND. VOU_TYPE='PR' .AND. DATE=m.DATE1
PACK

SELECT FIXBILL
DELETE FOR BNO=m.VOU_NO1
PACK
And have you checked if your logical functions are correct, I mean are you sure that you have any records that matches the conditions?

NB! Be aware that DATE is a reserved word, I would advice against using it as a field name!

>Dear Experts
>
>I have four dbf's as follows
>
>Fixbook, index bill_no
>Vouchers, index vou_no
>Vou_sum, index vou_no
>Fixbill, index bno
>
>Data in all dbf's is about similar.
>To delete a record from all dbf's I use following command
>But the problem is when I issue command the data from only first dbf, Fixbook, is deleted and in other theree dbf's remain same as previous.
>
>In Vouchers.dbf there is double entry of any vou_no, DR & Cr. and other
>three dbf's has single entry.
>
>Please enable my codes to delete same vou_no from all four dbf's.
>
>Thanks in advance
>
>SELECT FIXBOOK
>SCATTER MEMVAR
>ACC_CODE2 = m.ACC_CODE
>CODE2 = m.ACC_CODE
>DATE1 = m.FIX_DATE
>VOU_NO2 = m.VOU_NO
>VOU_NO1=THISFORM.TEXT12.VALUE
>
>DELETE FOR BILL_NO=VOU_NO1
>PACK
>
>SELECT VOUCHERS
>DELETE FOR VOU_NO=VOU_NO2 .AND. VOU_TYPE='PR' .AND. DATE=DATE1
>PACK
>
>SELECT VOU_SUM
>DELETE FOR VOU_NO=VOU_NO2 .AND. VOU_TYPE='PR' .AND. DATE=DATE1
>PACK
>
>SELECT FIXBILL
>DELETE FOR BNO=VOU_NO1
>PACK
>
Previous
Reply
Map
View

Click here to load this message in the networking platform