Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot Update Table
Message
From
29/11/1999 06:50:56
 
 
To
29/11/1999 04:41:44
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00296294
Message ID:
00296314
Views:
24
Hi Dennis,

Are you getting any error messages?

Try to run the functions through the debugger (SET STEP ON) to see the result after each line of code.




>I have a problem in update the delete/insert record(s) into the table after close the windows/or through a exit button.
>Is this any coding error in this two INSERT and DELETE functions.
>Please help me to solve problem a.s.a.p.
>
>The following is the coding of the INSERT FUNCTION
>
>SELECT ODETAIL
>lcOldTalk = SET("TALK")
>SET TALK OFF
>lcOldDeleted = SET("DELETED")
>SET DELETED OFF
>** Insert new record
>APPEND BLANK
>REPLACE odetail.orderno WITH Order.OrderNo IN odetail
>*REPLACE order_id with lMaxID in orders
>** Restore talk setting
>SET TALK &lcOldTalk
>SET DELETED &lcOldDeleted
>SELECT ORDER
>THISFORM.Refresh
>
>**end of INSERT FUNCTION
>
>The following is the coding of the DELETE FUNCTION
>
>#DEFINE MSGBOX_YES 6
>#DEFINE C_MSGBOX1 36
>#DEFINE C_DELETE1_LOC "Are you sure you want to delete the order number "
>#DEFINE C_DELETE2_LOC "?"
>** Note that there is no RI procedures built-in to the testdata database
>** so that there will be orphan records left in the orditems table after
>** deleting the records from the Customer and Orders table.
>lcMessage = C_DELETE1_LOC + ALLTRIM(ODetail.OrderNo) +ALLTRIM(ODetail.StockNo)+ C_DELETE2_LOC
>lcOrderID = Order.OrderNo
>IF MESSAGEBOX(lcMessage,C_MSGBOX1) = MSGBOX_YES
> SELECT ODETAIL
> DELETE
> IF !EOF()
> SKIP 1
> ENDIF
> IF EOF() AND !BOF()
> SKIP -1
> ENDIF
> THISFORM.Refresh
>ENDIF
>
>**END OF DELETE FUNCTION
>
>Waiting for any advice.
>Many thanks for any assistance.
>
>Dennis
Benn Kjaer
MS Certified Professional - Visual Foxpro

"There is something rotten in the state of Denmark"
"Why make user-friendly programs, when there aren’t any friendly users :o)"
Previous
Reply
Map
View

Click here to load this message in the networking platform