Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

All: My situation is in an EXE th

Status
Not open for further replies.

TheBulldog

Programmer
Nov 29, 2001
11
US
All:
My situation is in an EXE that is installed on a network drive of a Windows 2000 Server, but run from a local workstation, Windows 98 workstations.

The process that is failing is an End of Month process where MAAAAANY free tables are updated. It has happened 3 times today. 2 reporting sites rebooted the workstation, and re-ran the process and the process completed OK.

At the 3rd site, the entire data folder had to be copied from the network to the local drive, the process completed and all data was copied back to the network drive.

UPDEOM2.prg contains 3 different functions. The process calls the first function which calls the 2nd function which calls the 3rd function. There is no Set Procedure to UPDEOM2 in the form method that calls it.

The error is in a parameterized view that is as follows:

SELECT Mastpro.pprod, Mastpro.pdesc, Mastpro.ppkg, Mastpro.pmisc,;
Mastpro.pbtlscs, Mastpro.pequiv, Mastpro.prepnt, Mastpro.preqty,;
Mastpro.pdepnum, Mastpro.pcontyp, Mastpro.pgentyp, Mastpro.pprdtyp,;
Mastpro.prptgrp, Mastpro.pbin, Mastpro.pbuycd, Mastpro.pdcommv,;
Mastpro.phcommv, Mastpro.pscommv, Mastpro.pusedscm, Mastpro.pusehlcm,;
Mastpro.pinclsh, Mastpro.psplit, Mastpro.ptaxcd, Mastpro.p3,;
Mastpro.pincldly, Mastpro.pinclprc, Mastpro.poptd, Mastpro.popte,;
Mastpro.poptf, Mastpro.prtlprc, Mastpro.prtlprcb, Mastpro.pchgequiv,;
Mastpro.pnotused, Mastpro.prcdesc, Mastpro.prcupd, Mastpro.pkga_grp,;
Mastpro.quot_grp, Mastpro.prcunit, Mastpro.padddate, Mastpro.pdexpkg,;
Mastpro.pdexunit, Mastpro.pdexupc, Mastpro.pqfactor, Mastpro.pkgweight,;
Mastpro.pkgvolume, Mastpro.equcmpcode, Mastpro.ppdcn, Mastpro.pbudnet,;
Mastpro.pbudsell, Mastpro.pediuom, Mastpro.pconsupcid, Mastpro.pconsupc,;
Mastpro.pcaseupc, Mastpro.pedipacks, Mastpro.pedisize, Mastpro.pediszuom,;
Mastpro.prefill, Mastpro.pcount, Mastpro.pweight, Mastpro.pupcsuffix,;
Mastpro.pcspallet, Mastpro.glsales, Mastpro.glqtydsct, Mastpro.glmixdsct,;
Mastpro.glovrddsct, Mastpro.glfreedsct, Mastpro.hhcpkgsize,;
Mastpro.pfinmeas, Mastpro.pfinpack, Mastpro.ppackscase,;
Mastpro.punitspack, Mastpro.pupccase, Mastpro.pupcpack, Mastpro.pupcunit,;
Mastpro.phghtcase, Mastpro.pwidthcase, Mastpro.plngthcase,;
Mastpro.phghtpack, Mastpro.pwidthpack, Mastpro.plngthpack,;
Mastpro.pcoupon, Mastpro.paddtime, Mastpro.pchgdate, Mastpro.pchgtime,;
Mastpro.pdeldate, Mastpro.pdeltime, Mastpro.preadddate,;
Mastpro.preaddtime, Mastpro.paxcbevco, Mastpro.hhcbrand,;
Mastpro.pcodedate, Mastpro.pshelflife, Mastpro.pcddttype,;
Mastpro.ndiinclude, Mastpro.poptj, Mastpro.poptk, Mastpro.poptl,;
Mastpro.plongdesc, Mastpro.pvintage, Mastpro.rsdescln1,;
Mastpro.rsdescln2, Mastpro.paxcprod, Mastpro.rsdescds1,;
Mastpro.pincldsinv, Mastpro.rsdescds2, Mwdpkg.typeid, Mwdpkg.typedesc,;
Mwdpkg.sellbyunit, Mwdpkg.fullornot, Mwdpkg.cntasdraft, Mastpro.poptp,;
Mastpro.poptq, Mastpro.poptr, Mastpro.pincldist, Mastpro.bdnsupp,;
Mastpro.bdnproof, Mastpro.locnetpkg, Mastpro.glinven, Mastpro.glcost;
FROM mastpro INNER JOIN mwdpkg ;
ON packagetypeid(Mastpro.pprdtyp,Mastpro.pgentyp) = Mwdpkg.typeid;
WHERE Mastpro.pprod = ?gcpprod

I bolded the only .prg in the view. This view is basically a "Select every field in the table" plus 5 fields from another table.

Any thoughts?
 
If you are selecting EVERY field in the table, you can avoid listing all the fields by using * instead, ie:
Code:
SELECT MastPro.*, Mwdpkg.typeid, Mwdpkg.typedesc,; 
       Mwdpkg.sellbyunit, Mwdpkg.fullornot, ;
       Mwdpkg.cntasdraft, Mastpro.poptp ;
  FROM  mastpro INNER JOIN mwdpkg ; 
    ON  packagetypeid(Mastpro.pprdtyp,Mastpro.pgentyp) = Mwdpkg.typeid; 
 WHERE Mastpro.pprod = ?gcpprod
You can also avoid the INNER JOIN logic by simply using the WHERE clause, which still gives you "inner join" functionality, (this makes VFP jump through different hoops, and may avoid the internal error), ie:
Code:
SELECT MastPro.*, Mwdpkg.typeid, Mwdpkg.typedesc,; 
       Mwdpkg.sellbyunit, Mwdpkg.fullornot, ;
       Mwdpkg.cntasdraft, Mastpro.poptp ;
  FROM  mastpro, mwdpkg ; 
 WHERE ( packagetypeid(Mastpro.pprdtyp,Mastpro.pgentyp) = Mwdpkg.typeid ) and (Mastpro.pprod = ?gcpprod )

You could avoid the "parameterization" of the query, by doing your own user input and put the users entry for gcpprod into a variable, and pass the variable instead (the only change in the select is, remove the "?" before the variable). If you're already doing your own input, the "?" isn't necessary.

Finally, You can avoid the variable from being part of the SELECT entirely by using macro replacement, ie:
...
Code:
and (Mastpro.pprod = ?gcpprod )
becomes
...
Code:
and (Mastpro.pprod = [&gcpprod] )
 
Thanks for the reply.
First as you know, the VFP view designer gets nasty if a new field is added to the table and you selected using *, so that is why the view is done the way it is.

Second, the efficiency of the parameterized view hasn't been an issue at the over 50 sites that have been using this process for at least 3 months.

The real problem is why a prg that is embedded in an .exe can't be found.
 
Ok; I've never used the View designer; I prefer to create all queries in Code where I have more direct control over exactly what i'm getting... most of my queries are issued from code anyway, so using the view designer would only add to the files I'd have to manage.

Spontaneously rebooting isn't necessarily indicating that the PRG in the .exe can't be found... it's just saying VFP is getting wacked out about something... it's encountering an unexpected condition.

I take it the sites that have been working with no problem are not running out of an EXE? Are they running from .APP's? or a collection of .PRGs?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top