text to cmd textmerge noshow exec InTransitRN endtext lr = SQLEXEC( curHandle, cmd, "sq") && sq is the cursor the data is loaded intoIn that code, it's executing the InTransitRN SP and then putting in a cursor called "sq". That SP has filters in it so it only shows one client's data, but it will show all of their data. Then in this code below:
SELECT; client_zip,; [<a href="javascript:back('BOL#~X~]+transform(bol_number)+[~]+[') "target="_self"> ]+[</a> ] as bol_number,; ref_num,; weight,; pro_number,; customer_name,; customer_state,; customer_zip,; carrier_name,; ship_date,; est_delivery,; appt_date,; latest_status_description,; latest_reason_description,; date_last_updated; FROM sq; WHERE bol_Number = ?m.fdBlNo; INTO CURSOR TQuery SELECT TQuery SET CENTURY ON recs=RECCOUNT()Actually now that I'm typing this out, it seems as if I'm telling it to select fields that the SP is already selecting, is that what's going on? At the same time though, if I remove the above SELECT I lose my table that gets generated through WestWind, which is generated right below the SELECT statement:
loSC = CREATEOBJECT("wwShowCursor") loSC.lCenterTable = .f. loSC.cHeaderBGColor = "black" &&"#336633" loSC.lAlternateRows = .T. loSC.cAlternatingBGColor = "white" &&"#EFEFEF" loSC.cTableBorder ="3" loSC.cTableWidth="1000" DIMENSION laHeaders[15] laHeaders[1] = "Ozp" laHeaders[2] = "BOL#" 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 that's the case then I'm just back where I was, because I don't know how to get the WHERE bol_Number = ?m.fdBlNo; working. It's not like I can put that in the SP itself, and I couldn't get it working any other way. That's the only way I've found that will take the input from the user and only display that record.
SELECT; >> client_zip,; >> bol_number,; >> ref_num,; >> weight,; >> pro_number,; >> customer_name,; >> customer_state,; >> customer_zip,; >> carrier_name,; >> ship_date,; >> est_delivery,; >> appt_date,; >> latest_status_description,; >> latest_reason_description,; >> date_last_updated; >> FROM sq; >> WHERE bol_Number = ?m.fdBlNo; >> INTO CURSOR TQuery >> SELECT TQuery >> SET CENTURY ON >> recs=RECCOUNT()>>
text to cmd textmerge noshow >>>>*!* select top (200) bol_number, pro_number, client_city, client_state, client_zip, >>>>*!* customer_city, customer_state, customer_zip, ship_date >>>>*!* FROM <<TheSQLTable>> >>>>*!* WHERE bol_Number = ?m.fdBlNo >>>>*!* endtext>>>>
FUNCTION r214input >>>> >>>>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 InTransit ?']+ALLTRIM(user.cclientcd)+['] >>>>text to cmd textmerge noshow >>>>exec InTransitRN >>>>endtext >>>>lr = SQLEXEC( curHandle, cmd, "sq") && sq is the cursor the data is loaded into >>>> >>>> >>>>IF SQLEXEC( curHandle, cmd, "sq") = -1 >>>>messagebox(message()) >>>>ENDIF >>>> >>>>SELECT; >>>> client_zip,; >>>> bol_number,; >>>> ref_num,; >>>> weight,; >>>> pro_number,; >>>> customer_name,; >>>> customer_state,; >>>> customer_zip,; >>>> carrier_name,; >>>> ship_date,; >>>> est_delivery,; >>>> appt_date,; >>>> latest_status_description,; >>>> latest_reason_description,; >>>> date_last_updated; >>>> FROM sq; >>>> INTO CURSOR TQuery >>>> SELECT TQuery >>>> SET CENTURY ON >>>> recs=RECCOUNT() >>>> >>>>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[15] >>>>laHeaders[1] = "Ozp" >>>>laHeaders[2] = "BOL#" >>>>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() >>>> >>>>Response.ExpandTemplate(goWCServer.oConfig.oTask.cBTSHTMPath+"r214Input.htm") >>>>ENDFUNC >>>>>>>>
exec InTransitRN ?m.fdBlNo
>>>>>>exec lnTransitRN