Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot Append to database from remote view
Message
From
16/03/1999 12:37:58
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00198025
Message ID:
00198193
Views:
26
Records requiring updating for existing mdb data updated just fine. I just can't APPEND new records. Could this be something to do with the way the Access mdb is configured? Is there a property or something that inhibits additions? Sure could use some help...
>
>So you append the records, then use TABLEUPDATE() and it returns .T., but the records aren't added? That's strange. If you're using table buffering make sure you use the all rows parameter in TABLEUPDATE() (i.e. TABLEUPDATE(1)).


I did and it still doesn't append. Things are getting desperate for me now. Perhaps if you saw the code that I use you could spot something that I've omitted? Here it is:

* Select all header & Detail records scheduled for populating Contranet database

LPARAMETERS cName, cClass
LOCAL linecount, misok
set procedure to main additive
ON ERROR DO errhand && errhand is the error handler procedure
* Get marked header records
SELECT * FROM cashead WHERE markxfr = .T. INTO CURSOR selheadr ORDER BY cas_no
OPEN DATABASE vfpcontra exclu
SET MULTILOCKS ON

USE hdrview in 0 && Open header table view

* Set buffering mode and store logical result
lSuccess=CURSORSETPROP("Buffering", 5, "hdrview")
IF lSuccess = .T.

ELSE
=MESSAGEBOX("Buffering NOT successful!",0,"Operation Status")
ENDIF

USE detview IN 0 && Detail view for detail items

lSuccess=CURSORSETPROP("Buffering", 5, "detview")
IF lSuccess = .T.

ELSE
=MESSAGEBOX("Buffering NOT successful!",0,"Operation Status")
ENDIF
if !used('casdetl.dbf')
use casdetl in 0
endif
SELECT selheadr


SCAN
* Build Header Record
SELECT hdrview
APPEND BLANK
REPLACE hdrview.invid WITH "VLT"+alltrim(STR(selheadr.inv_no))
REPLACE hdrview.invdate WITH dtot(selheadr.inv_date)
REPLACE hdrview.company WITH " "
REPLACE hdrview.state WITH "FL"
REPLACE hdrview.authno WITH ALLTRIM(selheadr.aut_no)
REPLACE hdrview.beg_date WITH dtot(selheadr.pd_beg)
REPLACE hdrview.end_date WITH dtot(selheadr.pd_end)
REPLACE hdrview.cur_stat WITH "Ready"
REPLACE hdrview.empname WITH selheadr.empname
if selheadr.final = .T.
replace hdrview.final with "T"
else
replace hdrview.final with "N"
endif
REPLACE hdrview.budcen WITH selheadr.bud_ctr
REPLACE hdrview.ccfile WITH "D00384"
REPLACE hdrview.remarks WITH selheadr.remarks
REPLACE hdrview.eff_date WITH dtot(selheadr.DATE)
* REPLACE hdrview.accepted WITH selheadr.accepted
* replace hdrview.invtype with selheadr.
* replace hdrview.send_to with selheadr.

SELECT casdetl
linecount = 0
SCAN FOR casdetl.cas_no = selheadr.cas_no

SELECT detview
APPEND BLANK
linecount = linecount + 1
REPLACE detview.invid WITH "VLT"+alltrim(STR(selheadr.inv_no))
REPLACE detview.seqno WITH alltrim(str(linecount))
REPLACE detview.wrkloc WITH casdetl.locdet
* replace detview.workact with
REPLACE detview.cascode WITH casdetl.cas_code
REPLACE detview.DESC WITH casdetl.cas_desc
REPLACE detview.acc WITH casdetl.act_no
* replace detview.area with
* replace detview.rem with
REPLACE detview.workord WITH casdetl.wrkdet_no
* replace detview.sketch with casdetl.locdet
* replace detview.cec with casdetl.locdet
REPLACE detview.qty WITH casdetl.qty
REPLACE detview.price WITH casdetl.price
REPLACE detview.TOTAL WITH qty * price
SELECT casdetl
ENDSCAN && Casdetail file
select selheadr
ENDSCAN && header Scan

* update here and remove xfr marks from Header file

*
*
SELECT Hdrview

=TABLEUPDATE(1)

SELECT detview

=TABLEUPDATE(1)
**** The only records that didn't update were the new records that req'd appending
* Reset transfer markers in Header file
* if misok
* select cashead
* replace cashead.xferred with .T. for cashead.markxfr = .T. all
* replace cashead.markxfr with .F. all
* endif
wait window "ContraNet Database Update Completed..Press any key to continue...)"

Really appreciate you taking the time. I'm almost out of options now. THanks so much.

Barry
If at first you don't succeed......SET STEP ON!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform