Hi all,
I'm looking to search for a value within a table and if it it is located I want to delete the row/rows it occurs in and replace it with some queried info PRIV:Routecheck.db).
I am trying to use the following code but am having various problems. One being that each record found with the value brings up the message question (I only want it to show once).
var
tcCompare tCursor
pltnum string
endvar
pltnum = plateid.value
tcCompare.open("FullFinalRoute.db"
tcCompare.edit()
scan tcCompare:
if tcCompare."PlateID" = pltnum then
if msgQuestion("Saving Route",
"You are overwriting an existing route " + pltnum + ". Are you sure?" = "Yes" then
setMouseShape(MOUSEWAIT, TRUE)
qVar = Query
FullFinalRoute.db | plateid |
Delete | ~pltnum |
endquery
if not qVar.executeQBE() then
errorshow()
endif
dt.SetSource ( "RIV:RouteCheck.db" )
if dt.getSourceType ( ) = DTASCIIFixed Then
dt.loadDestSpec ( "SpecTable" )
endIf
dt.setDest ( "FullFinalRoute.db" )
if not dt.getAppend () then
dt.setAppend ( True )
endif
dt.transferData ( )
setMouseShape(MOUSEARROW, TRUE)
else
setMouseShape(MOUSEARROW, TRUE)
endif
else
dt.SetSource ( "RIV:RouteCheck.db" )
if dt.getSourceType ( ) = DTASCIIFixed Then
dt.loadDestSpec ( "SpecTable" )
endIf
dt.setDest ( "FullFinalRoute.db" )
if not dt.getAppend () then
dt.setAppend ( True )
endif
dt.transferData ( )
endscan
tcCompare.endEdit()
tcCompare.close()
endif
Can anyone help?
Thanks,
Woody.
I'm looking to search for a value within a table and if it it is located I want to delete the row/rows it occurs in and replace it with some queried info PRIV:Routecheck.db).
I am trying to use the following code but am having various problems. One being that each record found with the value brings up the message question (I only want it to show once).
var
tcCompare tCursor
pltnum string
endvar
pltnum = plateid.value
tcCompare.open("FullFinalRoute.db"
tcCompare.edit()
scan tcCompare:
if tcCompare."PlateID" = pltnum then
if msgQuestion("Saving Route",
"You are overwriting an existing route " + pltnum + ". Are you sure?" = "Yes" then
setMouseShape(MOUSEWAIT, TRUE)
qVar = Query
FullFinalRoute.db | plateid |
Delete | ~pltnum |
endquery
if not qVar.executeQBE() then
errorshow()
endif
dt.SetSource ( "RIV:RouteCheck.db" )
if dt.getSourceType ( ) = DTASCIIFixed Then
dt.loadDestSpec ( "SpecTable" )
endIf
dt.setDest ( "FullFinalRoute.db" )
if not dt.getAppend () then
dt.setAppend ( True )
endif
dt.transferData ( )
setMouseShape(MOUSEARROW, TRUE)
else
setMouseShape(MOUSEARROW, TRUE)
endif
else
dt.SetSource ( "RIV:RouteCheck.db" )
if dt.getSourceType ( ) = DTASCIIFixed Then
dt.loadDestSpec ( "SpecTable" )
endIf
dt.setDest ( "FullFinalRoute.db" )
if not dt.getAppend () then
dt.setAppend ( True )
endif
dt.transferData ( )
endscan
tcCompare.endEdit()
tcCompare.close()
endif
Can anyone help?
Thanks,
Woody.