Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WestWind/database filter help
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01516279
Message ID:
01520593
Vues:
166
Alright I figured out how to get the table to display only when the link is clicked. I ran into something else though (surprise, surprise) as I was trying to optimize the code. The way I had it was working, but it was basically running through a query twice and taking 20 seconds to display each table. I streamlined the first one and it display in under a second, but when I tried the same thing with the second one, it's like it's still looking at the first stored procedure.

Basically, there's a different SP for both tables. When I click the link to show the second table it is pulling data from the first SP. Newest code:
FUNCTION r214input
fdBlNo2 = ALLTRIM(UPPER(Request.Form("v")))
fdBlNo = ALLTRIM(UPPER(Request.Form("blno")))
fdBN   = Request.Form("BN")
fdPK   = Request.Form("PK")
mEr = ""
lcTable=""
m.protbl = ""
m.rplen = 0

DO CASE
CASE ! EMPTY(fdBN)
	SQLWhere = "BN=" + ALLTRIM(fdBN)
	IF ! EMPTY(fdPK)
		SQLWhere = SQLWhere + " AND PK=" + ALLTRIM(fdPK)
	ENDIF 
OTHERWISE
	lcTable = "Not Found" 
	Response.Expandtemplate(goWCServer.oConfig.oTask.cHtmPath+"r214input.htm")
	RETURN 
ENDCASE 
lcTable="TBL Master File<br>"


THESQLDB = "TBL_BL"	
THESQLTABLE = "TBL_BOL"
THESERVER = goWCServer.oConfig.oTask.cSQLServer
usr = ""
pas = ""
ConnStr = [driver=SQL Server; server=]+THESERVER+[; database=]+THESQLDB+[; uid=]+usr+[;pwd=]+pas+[; Trusted_Connection=No;]
curHandle = SQLstringCONNECT( connStr )
cmd = [exec InTransitRN ?']+fdBlNo+[']

lr = SQLEXEC( curHandle, cmd, "sq")  && sq is the cursor the data is loaded into

		
loSC = CREATEOBJECT("wwShowCursor")
loSC.lCenterTable = .f.
loSC.cHeaderBGColor = "black"   &&"#336633"
loSC.lAlternateRows = .T.
loSC.cAlternatingBGColor = "white"  &&"#EFEFEF"
loSC.cTableBorder ="3"
loSC.cTableWidth="1300"
DIMENSION laHeaders[15]
laHeaders[1] = "BOL#"
laHeaders[2] = "Ozp"
laHeaders[3] = "Ref#"
laHeaders[4] = "Weight"
laHeaders[5] = "Pro#"
laHeaders[6] = "Customer Name"
laHeaders[7] = "Dst"
laHeaders[8] = "Dzp"
laHeaders[9] = "Carrier"
laHeaders[10] = "Ship Date"
laHeaders[11] = "Est_Delivery"
laHeaders[12] = "Appt. Date"
laHeaders[13] = "Latest Status"
laHeaders[14] = "Latest Reason"
laHeaders[15] = "Last Updated"
loSC.BuildFieldListHeader(@laHeaders)
loSC.lSumNumerics = .t.
loSC.ShowCursor()
lctable=loSC.GetOutput()

IF !EMPTY (fdBlNo2)


*******************************************
THIS IS WHERE THE ISSUE IS         * 
*******************************************
THESQLDB = "TBL_BL"	
THESQLTABLE = "TBL_BOL"
THESERVER = goWCServer.oConfig.oTask.cSQLServer
usr = ""
pas = ""
ConnStr = [driver=SQL Server; server=]+THESERVER+[; database=]+THESQLDB+[; uid=]+usr+[;pwd=]+pas+[; Trusted_Connection=No;]
curHandle2 = SQLstringCONNECT( connStr )
cmd2 = [exec InTransitRNStatus ?']+fdBlNo+[']
lr2 = SQLEXEC( curHandle2, cmd2, "sq2")  && sq is the cursor the data is loaded into

loSC = CREATEOBJECT("wwShowCursor")
loSC.lCenterTable = .f.
loSC.cHeaderBGColor = "black"   &&"#336633"
loSC.lAlternateRows = .T.
loSC.cAlternatingBGColor = "white"  &&"#EFEFEF"
loSC.cTableBorder ="3"
loSC.cTableWidth="750"
DIMENSION laHeaders[6]
laHeaders[1] = "Date Added"
laHeaders[2] = "Status date"
laHeaders[3] = "Status time"
laHeaders[4] = "City"
laHeaders[5] = "State"
laHeaders[6] = "Equipment ID"
loSC.BuildFieldListHeader(@laHeaders)
loSC.lSumNumerics = .t.
loSC.ShowCursor()
protbl=loSC.GetOutput()
ENDIF

Response.ExpandTemplate(goWCServer.oConfig.oTask.cBTSHTMPath+"r214Input.htm")
ENDFUNC
So it's supposed to be running the InTransitRNStatus SP but it's only pulling data from the first table's SP (InTransitRN). It's basically duplicating the first table. I'm not sure why it's not using the correct SP, any ideas?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform