OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Data dissapears when changed to sql

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> Data dissapears when changed to sql
Page: [1]
 
dzirkelb1

 

Posts: 1433
Joined: 10/5/2004
From: Cedar Rapids, Iowa
Status: offline

 
Data dissapears when changed to sql - 6/1/2009 12:12:38   
I have a wierd problem. First of, I am trying to change my data connection from an access linked table to an sql table, to directly going to sql. This works ok, no errors. However, there seems to be some data that dissapears when I do this. I can literally change the connection, and just loose data when I display it.

Now, the wierder part, is if I do a response.write(rs("ShipCity")) right below the conection, it displays the data to the screen AND shows up on the text box...when I comment that out, it dissapears on the text box.

If I assign variables to every item and place those in the text box, then they display correctly. I would like to avoid this, however, as there are a lot of fields to do this to.

So, I am going to post the entire page code and see if anyone has any sort of idea what could be causing this and what I can do to fix it.

<!-- #include file="dbQS.asp" -->
<%
'4/9 Changed connection to SQL
'4/13 Made the ship via into a variable
'4/13 Changed connection back to dbole to make disappearing data reappear

strUser = Request.ServerVariables("AUTH_USER")

set rs = Server.CreateObject ("adodb.RecordSet")
ssql = "prcWebECISUserCheckVendorMgmtEdit '"& strUser &"'"
rs.Open ssql, dbc, adOpenForwardOnly, adLockReadOnly

if not rs.EOF then
	sEdit = 1
else
	sEdit = 0
end if

rs.Close
set rs = nothing

set rs = Server.CreateObject ("adodb.RecordSet")
ssql = "prcWebECISVendorMasterImageCount " & Request.QueryString ("Vendor")
rs.Open ssql, dbc, adOpenForwardOnly, adLockReadOnly

if not rs.EOF then
	sImageCount = rs("ImageCount")
else
	sImageCount = 0
end if

rs.Close
set rs = nothing
%>
<html>
<head>
<title>Vendor Information Screen</title>
</head>
<Body bgcolor=Silver>
<%
set rs = Server.CreateObject ("adodb.Recordset")
ssql = "SELECT VendorNotes, RotationStatus, Mfg AS Mfg, Distributor, VendorEmail, MarginRating, ConfName, ConfEmail, ContractFileDirectory, VendorID AS VID, Debit_Attn AS DebitAttn, Debit_Add1 AS DebitAdd1, Debit_Add2 AS DebitAdd2, Debit_City AS DebitCity, Debit_St AS DebitSt, Debit_Zip AS DebitZip, Debit_Ph AS DebitPh, Debit_Fx AS DebitFx, Ship_Attn AS ShipAttn, Ship_Add1 AS ShipAdd1, Ship_Add2 AS ShipAdd2, Ship_City AS ShipCity, Ship_St AS ShipSt, Ship_Zip AS ShipZip, Ship_Ph AS ShipPh, Ship_Fx AS ShipFx, PrimaryEmail AS EMail, Alt_Ship_Attn AS ASAT, Alt_Ship_Add1 AS ASA1, Alt_Ship_Add2 AS ASA2, Alt_Ship_City AS ASCI, Alt_Ship_St AS ASST, Alt_Ship_Zip AS ASZI, Alt_Ship_Ph AS ASPH, Alt_Ship_Fx AS ASFA, [Dee Ordering Schedule] AS DOS, [Drop Shipments] AS DropShip, Minimums AS Minim, [Prepaid Freight Terms] AS PFT, [Special Shipping Restrictions] AS SSR, [Service or Handling Charges] AS SHC, [Order Cutoff - CST] AS OrderCut, [Shipment Splitting] AS ShipSplit, [High Freight Flag Mfg] AS HFFM, [Other Notes] AS Notes, [Return Policy] AS [Return], Approved AS Apv, AddDate AS AddDate, COOPContactName AS CCN, COOPContactPhone AS CCP, COOPContactFax AS CCF, COOPContactEmail AS CCE, COOPContactAddress AS CCA, COOPFundsAvail AS CFA, COOPFundsCalc AS CFC, COOPNotes AS CN, PriceListEndDate AS PLED, PriceListNotes AS PLN, HowApproved AS HA, ShipVia AS SV, DynVendorCode AS DVC, StockRotPolicy AS VSRP, Jan AS VJan, Feb AS VFeb, Mar AS VMar, Apr AS VApr, May AS VMay, Jun AS VJun, Jul AS VJul, Aug AS VAug, VendorSpecialNotes, Sep AS VSep, Oct AS VOct, Nov AS VNov, [Dec] AS VDec, ApprovalNotes, OpportunitiesPassedLost, MgmtReviewBeforePO, WebAddress"
ssql = ssql & " FROM [VENDOR MASTER]"
ssql = ssql & " WHERE (VendorID = "&request.querystring("Vendor")&")"
rs.Open ssql, dbc, adOpenForwardOnly, adLockReadOnly
response.write(rs("ShipCity"))

strShipVia = rs("SV")
%>
<font size=1>QF-74-01-01  <font FACE="Verdana" SIZE="4">Vendor Information Screen
<td width="200"></td>
<td><input type="button" style="font-family: Verdana; font-size: 8pt" id="cmdHome" name="cmdHome" onclick="Go('dee_home.asp')" value=" Home "></td>
<td><input type="button" style="font-family: Verdana; font-size: 8pt" id="cmdsearch" name="cmdSearch" onclick="Go('vendor_search.asp')" value=" Search "></td>
<td><input type="button" style="font-family: Verdana; font-size: 8pt" id="cmdUpload" name="cmdUpload" onclick="Go('vendorimagelist.asp?Vendor=<%=Request.QueryString("Vendor")%>')" value=" Documents/Images(<%=sImageCount%>)"></td>
<td><input type="button" style="font-family: Verdana; font-size: 8pt" id="cmdReport" name="cmdReport" onclick="Go('vendorreport.asp?Vendor=<%=Request.QueryString("Vendor")%>')" value="Vendor Meeting/Call Reports"></td>
<td><input type="button" style="font-family: Verdana; font-size: 8pt" id="cmdOpenPO" name="cmdOpenPO" onclick="Go('VendorOpenPO.asp?Vendor=<%=Request.QueryString("Vendor")%>')" value="Open PO's"></td>
<td><input type="button" style="font-family: Verdana; font-size: 8pt" id="cmdOpenReq" name="cmdOpenReq" onclick="Go('VendorOpenReq.asp?Vendor=<%=Request.QueryString("Vendor")%>')" value="Open Req's"></td>
<td><input type="button" style="font-family: Verdana; font-size: 8pt" id="cmdVendorSales" name="cmdVendorSales" onclick="Go('VendorSalesByRep.asp?Vendor=<%=Request.QueryString("Vendor")%>')" value="Your Sales History by Customer"></td>
<p>
<%
if sEdit = 1 then
%>
	<form name=frmgeneral action=vendorinfo-save.asp method=post>
	<input type=submit id=cmdsave name=cmdsave value="Save">
	<input type=hidden id=txtVID name=txtVID value=<%=Request.QueryString ("Vendor")%>>
	<font face="Verdana" size=1><a href="vendor_search.asp?radioSearch=VendorID&txtSearch=<%=rs("VID")%>&submitPSSearch=Performance Search">Performance Search</a>
<%
end if
%>
			<table cellpadding=5 border=1>
				<tr>
					<th><font FACE="Verdana" size=1>Vendor Name</th>
					<th><font FACE="Verdana" size=1>Vendor #</th>
					<th><font FACE="Verdana" size=1>Debit Attn</th>
					<th><font FACE="Verdana" size=1>Debit Address</th>
					<th><font FACE="Verdana" size=1>Debit City</th>
					<th><font FACE="Verdana" size=1>Debit State</th>
					<th><font FACE="Verdana" size=1>Debit Zip</th>
					<th><font FACE="Verdana" size=1>Debit Phone</th>
					<th><font FACE="Verdana" size=1>Debit Fax</th>
					
				</tr>
				<tr>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="20" name="txtMFG" id="txtMFG" value="<%=rs("Mfg")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("Mfg")%> </td><%end if%>
				   <td><font FACE="Verdana" size=1><%=rs("VID")%> </td>					
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtDebitAttn" id="txtDebitAttn" value="<%=rs("DebitAttn")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("DebitAttn")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtDebitAdd1" id="txtDebitAdd1" value="<%=rs("DebitAdd1")%>"><br><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtDebitAdd2" id="txtDebitAdd2" value="<%=rs("DebitAdd2")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("DebitAdd1")%><br><%=rs("DebitAdd2")%></td><%end if%>

<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtDebitCity" id="txtDebitCity" value="<%=rs("DebitCity")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("DebitCity")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtDebitSt" id="txtDebitSt" value="<%=rs("DebitSt")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("DebitSt")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtDebitZip" id="txtDebitZip" value="<%=rs("DebitZip")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("DebitZip")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtDebitPh" id="txtDebitPh" value="<%=rs("DebitPh")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("DebitPh")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtDebitFx" id="txtDebitFx" value="<%=rs("DebitFx")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("DebitFx")%> </td><%end if%>
				</tr>
			</table>
			<table cellpadding=5 border=1>
				<tr>
					<th><font FACE="Verdana" size=1>Ship Attn</th>
					<th><font FACE="Verdana" size=1>Ship Address</th>
					<th><font FACE="Verdana" size=1>Ship City</th>
					<th><font FACE="Verdana" size=1>Ship State</th>
					<th><font FACE="Verdana" size=1>Ship Zip</th>
					<th><font FACE="Verdana" size=1>Ship Phone</th>
					<th><font FACE="Verdana" size=1>Ship Fax</th>
					<th><font FACE="Verdana" size=1>Primary E-Mail</th>
				</tr>
				<tr>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtShipAttn" id="txtShipAttn" value="<%=rs("ShipAttn")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ShipAttn")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtShipAdd1" id="txtShipAdd1" value="<%=rs("ShipAdd1")%>"><br><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtShipAdd2" id="txtShipAdd2" value="<%=rs("ShipAdd2")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ShipAdd1")%><br><%=rs("ShipAdd2")%></td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtShipCity" id="txtShipCity" value="<%=rs("ShipCity")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ShipCity")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtShipSt" id="txtShipSt" value="<%=rs("ShipSt")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ShipSt")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtShipZip" id="txtShipZip" value="<%=rs("ShipZip")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ShipZip")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="20" name="txtShipPh" id="txtShipPh" value="<%=rs("ShipPh")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ShipPh")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="20" name="txtShipFx" id="txtShipFx" value="<%=rs("ShipFx")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ShipFx")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="20" name="txtShipEmail" id="txtShipEmail" value="<%=rs("EMail")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("EMail")%> </td><%end if%>
				</tr>
			</table>
			
			<table cellpadding="5" border="1">
				<tr>
					<th><font face="verdana" size="1">Vendor Email</font></th>
					<th><font face="verdana" size="1">Conf Email</font></th>
					<th><font face="verdana" size="1">Minimums</font></th>
					<th><font face="verdana" size="1">Drop Ship</font></th>
					<th><font face="verdana" size="1">Prepaid Freight Terms</font></th>
					<th><font face="verdana" size="1">Order Cutoff-CST</font></th>
					<th><font face="verdana" size="1">Stock Rotation Policy</font></th>
				</tr>
					<%if sEdit=1 then%>
						<td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="25" name="txtVendorEmail" id="txtVendorEmail" value="<%=rs("VendorEmail")%>"></td>
						<td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="25" name="txtConfirmingEmail" id="txtConfirmingEmail" value="<%=rs("ConfEmail")%>"></td>
						<td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtMinimums" id="txtMinimums" value="<%=rs("Minim")%>"></td>
						<td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtDropShipment" id="txtDropShipment" value="<%=rs("DropShip")%>"></td>
						<td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtPpdFrtTerms" id="txtPpdFrtTerms" value="<%=rs("PFT")%>"></td>
						<td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtOrderCutoff" id="txtOrderCutoff" value="<%=rs("OrderCut")%>"></td>
						<td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="25" name="txtStockRotation" id="txtStockRotation" value="<%=rs("VSRP")%>"></td>
					<%else%>	
						<!--<td><font face="verdana" size="1"><a href="mailto:<%=rs("VendorEmail")%>"><%=rs("VendorEmail")%></a></font> </td>
						<td><font face="verdana" size="1"><a href="mailto:<%=rs("ConfEmail")%>"><%=rs("ConfEmail")%></a></font> </td>-->
						<td><font face="verdana" size="1"><a href="mailto:<%=rs("VendorEmail")%>"><%=rs("VendorEmail")%></a></font> </td>
						<td><font face="verdana" size="1"><%=rs("ConfEmail")%></font> </td>
						<td><font face="verdana" size="1"><%=rs("Minim")%></font> </td>
						<td><font face="verdana" size="1"><%=rs("DropShip")%></font> </td>
						<td><font face="verdana" size="1"><%=rs("PFT")%></font> </td>
						<td><font face="verdana" size="1"><%=rs("OrderCut")%></font> </td>
						<td><font face="verdana" size="1"><%=rs("VSRP")%></font> </td>
					<%end if%>
				</tr>
			</table>


			
			<table cellpadding=5 border=1>
				<tr>
					<th><font FACE="Verdana" size=1>Alt Ship Attn</th>
					<th><font FACE="Verdana" size=1>Alt Ship Address</th>
					<th><font FACE="Verdana" size=1>Alt Ship City</th>
					<th><font FACE="Verdana" size=1>Alt Ship State</th>
					<th><font FACE="Verdana" size=1>Alt Ship Zip</th>
					<th><font FACE="Verdana" size=1>Alt Ship Phone</th>
					<th><font FACE="Verdana" size=1>Alt Ship Fax</th>
					<th><font FACE="Verdana" size=1>Web Address</th>
				</tr>
				<tr>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtAltShipAttn" id="txtAltShipAttn" value="<%=rs("ASAT")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ASAT")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtAltShipAdd1" id="txtAltShipAdd1" value="<%=rs("ASA1")%>"><br><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtAltShipAdd2" id="txtAltShipAdd2" value="<%=rs("ASA2")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ASA1")%><br><%=rs("ASA2")%></td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtAltShipCity" id="txtAltShipCity" value="<%=rs("ASCI")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ASCI")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtAltShipSt" id="txtAltShipSt" value="<%=rs("ASST")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ASST")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtAltShipZip" id="txtAltShipZip" value="<%=rs("ASZI")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ASZI")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtAltShipPh" id="txtAltShipPh" value="<%=rs("ASPH")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ASPH")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtAltShipFx" id="txtAltShipFx" value="<%=rs("ASFA")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ASFA")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="30" name="txtWebAddress" id="txtWebAddress" value="<%=rs("WebAddress")%>"><br><a target="_blank" href="<%=rs("WebAddress")%>"><%=rs("WebAddress")%></a></td><%else%><td><font FACE="Verdana" size=1><%=rs("WebAddress")%> </td><%end if%>

				</tr>
			</table>
			<%
			sDay = WeekDay(Date())
			'Add days if weekend will affect 3 back
			if sDay = 1 then
				sDate = Date()-5
			end if
			if sDay = 2 then
				sDate = Date()-5
			end if
			if sDay = 3 then
				sDate = Date()-5
			end if
			if sDay = 4 then
				sDate = Date()-5
			end if
			if sDay = 5 then
				sDate = Date()-3
			end if
			if sDay = 6 then
				sDate = Date()-3
			end if
			if sDay = 7 then
				sDate = Date()-4
			end if

			' PO Headers
			set rs1 = Server.CreateObject ("adodb.Recordset")
			sql = "SELECT Count([PO NUMBER]) as POHeader FROM [PURCHASE ORDERS] WHERE (([ORIG REQ DATE] >= '"& sDate &"') AND (VendorID = " & Request.QueryString("Vendor") & ") AND (STATUS = 0))"
			rs1.Open sql, dbc, adOpenForwardOnly, adLockReadOnly
			
			if not rs1.EOF then
				sPOHeader = rs1("POHeader")
			else
				sPOHeader = 0
			end if
			
			rs1.Close
			set rs1 = nothing
			
			' PO Lines
			set rs1 = Server.CreateObject ("adodb.Recordset")
			
			sql = "SELECT Count(PORECGS1.[PO Number]) as PODetail FROM [PURCHASE ORDERS] RIGHT JOIN PORECGS1 ON [PURCHASE ORDERS].[PO NUMBER] = PORECGS1.[PO Number] WHERE (([ORIG REQ DATE] >= '"& sDate &"') AND ([PURCHASE ORDERS].VendorID = " & Request.QueryString("Vendor") & ") AND (STATUS = 0))"
			rs1.Open sql, dbc, adOpenForwardOnly, adLockReadOnly
			
			if not rs1.EOF then
				sPODetail = rs1("PODetail")
			else
				sPODetail = 0
			end if
			
			rs1.Close
			set rs1 = nothing
			
			' Req Header
			set rs1 = Server.CreateObject ("adodb.Recordset")
			sql = "SELECT Count([PO NUMBER]) as ReqHeader FROM [PURCHASE ORDERS] WHERE ((VendorID = " & Request.QueryString("Vendor") & ") AND (STATUS = 1))"
			rs1.Open sql, dbc, adOpenForwardOnly, adLockReadOnly
			
			if not rs1.EOF then
				sReqHeader = rs1("ReqHeader")
			else
				sReqHeader = 0
			end if
			
			rs1.Close
			set rs1 = nothing
			
			' Req Lines
			set rs1 = Server.CreateObject ("adodb.Recordset")
			
			sql = "SELECT Count(PORECGS1.[PO Number]) as ReqDetail FROM [PURCHASE ORDERS] RIGHT JOIN PORECGS1 ON [PURCHASE ORDERS].[PO NUMBER] = PORECGS1.[PO Number] WHERE (([PURCHASE ORDERS].VendorID = " & Request.QueryString("Vendor") & ") AND (STATUS = 1))"
			rs1.Open sql, dbc, adOpenForwardOnly, adLockReadOnly
			
			if not rs1.EOF then
				sReqDetail = rs1("ReqDetail")
			else
				sReqDetail = 0
			end if
			
			rs1.Close
			set rs1 = nothing
			
			' Req Dollars
			set rs1 = Server.CreateObject ("adodb.Recordset")
			
			sql = "SELECT Sum([PO Qty] * [Unit Acq Cost]) as ReqExt FROM [PURCHASE ORDERS] RIGHT JOIN PORECGS1 ON [PURCHASE ORDERS].[PO NUMBER] = PORECGS1.[PO Number] WHERE (([PURCHASE ORDERS].VendorID = " & Request.QueryString("Vendor") & ") AND (STATUS = 1))"
			rs1.Open sql, dbc, adOpenForwardOnly, adLockReadOnly
			
			if not rs1.EOF then
				sReqExt = rs1("ReqExt")
			else
				sReqExt = 0
			end if
			
			rs1.Close
			set rs1 = nothing
			%>
			<table cellpadding=5 border=1>
				<tr>
					<th><font face=verdana size=1>PO's Placed Last 3 Days</th>
					<th><font face=verdana size=1>PO Lines Placed Last 3 Days</th>
					<th><font face=verdana size=1>Open Req's</th>
					<th><font face=verdana size=1>Open Req Lines</th>
					<th><font face=verdana size=1>Open Req $</th>
				</tr>
				<tr>
					<td><font face=verdana size=1><%=sPOHeader%> </td>
					<td><font face=verdana size=1><%=sPODetail%> </td>
					<td><font face=verdana size=1><%=sReqHeader%> </td>
					<td><font face=verdana size=1><%=sReqDetail%> </td>
					<td><font face=verdana size=1><%=sReqExt%> </td>
				</tr>
			</table>
			<table cellpadding=5 border=1>
				<tr>
					<th><font FACE="Verdana" size=1>Dee Order Sch</th>
					<th><font FACE="Verdana" size=1>Special Ship Restrictions</th>
					<th><font FACE="Verdana" size=1>Service or Handling Charges</th>
					<th><font FACE="Verdana" size=1>Shipment Splitting</th>
					<th><font FACE="Verdana" size=1>High Frt Flag Mfg</th>
					<th><font FACE="Verdana" size=1>Other Notes</th>
					<th><font FACE="Verdana" size=1>Return Policy</th>
				</tr>
				<tr>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtDeeOrderSch" id="txtDeeOrderSch" value="<%=rs("DOS")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("DOS")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="20" name="txtSpecialShipRest" id="txtSpecialShipRest" value="<%=rs("SSR")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("SSR")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="20" name="txtServiceCharges" id="txtServiceCharges" value="<%=rs("SHC")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("SHC")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtShipmentSplit" id="txtShipmentSplit" value="<%=rs("ShipSplit")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ShipSplit")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtHightFrtFlag" id="txtHightFrtFlag" value="<%=rs("HFFM")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("HFFM")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txOtherNotes" id="txOtherNotes" value="<%=rs("Notes")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("Notes")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtReturnPolicy" id="txtReturnPolicy" value="<%=rs("Return")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("Return")%> </td><%end if%>
				</tr>
			</table>
			<table cellpadding=5 border=1>
				<tr>
					<th><font FACE="Verdana" size=1>Approved</th>
					<th><font FACE="Verdana" size=1>Appv Notes</th>
					<th><font FACE="Verdana" size=1>Add Date</th>
					<th><font FACE="Verdana" size=1>COOP Contact Name</th>
					<th><font FACE="Verdana" size=1>COOP Contact Phone</th>
					<th><font FACE="Verdana" size=1>COOP Contact Fax</th>
					<th><font FACE="Verdana" size=1>COOP Contact E-Mail</th>
					<th><font FACE="Verdana" size=1>COOP Contact Address</th>
					<th><font FACE="Verdana" size=1>COOP Funds Avail</th>
					<th><font FACE="Verdana" size=1>COOP Funds Calc</th>
					<th><font FACE="Verdana" size=1>COOP Notes</th>
				</tr>
				<tr>	
					<%
					if sEdit = 1 then
					%>
						<td><select style="font-family: Verdana; font-size: 8pt" id="selApv" name="selApv"><option value="Yes"<%if rs("Apv") = True then%> selected <%end if%>>Yes</option><option value="No"<%if rs("Apv") = False then%> selected <%end if%>>No</option></select></td>
						<td>
                        <input id="txtAppvNotes" name="txtAppvNotes" style="font-family: Verdana; font-size: 8pt" value="<%=rs("ApprovalNotes")%>" maxlength=254 size="20"></td>
					<%
					else
					
						if rs("Apv") = True then
							sApv = "Yes"
						else
							sApv = "No"
						end if
					%>
						<td><font FACE="Verdana" size=1><%=rs("Apv")%> </td>
						<td><font FACE="Verdana" size=1><%=rs("ApprovalNotes")%> </td>
						<input type=hidden id="selApv" name="selApv" value="<%=sApv%>">
						<input type=hidden id="txtAppvNotes" name="txtAppvNotes" value="<%=rs("ApprovalNotes")%>">
					<%
					end if
					%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtAddDate" id="txtAddDate" value="<%=rs("AddDate")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("AddDate")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtCOOPContactName" id="txtCOOPContactName" value="<%=rs("CCN")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("CCN")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtCOOPContactPh" id="txtCOOPContactPh" value="<%=rs("CCP")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("CCP")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtCOOPContactFx" id="txtCOOPContactFx" value="<%=rs("CCF")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("CCF")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtCOOPContactEmail" id="txtCOOPContactEmail" value="<%=rs("CCE")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("CCE")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtCOOPContactAdd" id="txtCOOPContactAdd" value="<%=rs("CCA")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("CCA")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtCOOPContactFundsAvail" id="txCtOOPContactFundsAvail" value="<%=rs("CFA")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("CFA")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtCOOPContactFundsCalc" id="txtCOOPContactFundsCalc" value="<%=rs("CFC")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("CFC")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtCOOPContactNotes" id="txtCOOPContactNotes" value="<%=rs("CN")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("CN")%> </td><%end if%>
				</tr>
			</table>
			<table cellpadding=5 border=1>
				<tr>
					<th><font FACE="Verdana" size=1>Mgmt Review Before PO</th>
					<th><font FACE="Verdana" size=1>Price List End Date</th>
					<th><font FACE="Verdana" size=1>Price List Notes</th>
					<th><font FACE="Verdana" size=1>How Approved</th>
					<th><font FACE="Verdana" size=1>Ship Via</th>
					<th><font FACE="Verdana" size=1>Dynamics Vendor Code</th>
				</tr>
				<tr>
				<tr>	
					<%
					if sEdit = 1 then
					%>
						<td><select style="font-family: Verdana; font-size: 8pt" id="selRevPO" name="selRevPO"><option value="Yes"<%if rs("MgmtReviewBeforePO") = True then%> selected <%end if%>>Yes</option><option value="No"<%if rs("MgmtReviewBeforePO") = False then%> selected <%end if%>>No</option></select></td>
					<%
					else
					
						if rs("MgmtReviewBeforePO") = True then
							sRevPO = "Yes"
						else
							sRevPO = "No"
						end if
					%>
						<td><font FACE="Verdana" size=1><%=rs("MgmtReviewBeforePO")%> </td>
						<input type=hidden id="selRevPO" name="selRevPO" value="<%=sApv%>">
					<%
					end if
					%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtPriceListEndDate" id="txtPriceListEndDate" value="<%=rs("PLED")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("PLED")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtPriceListNotes" id="txtPriceListNotes" value="<%=rs("PLN")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("PLN")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="20" name="txtHowApproved" id="txtHowApproved" value="<%=rs("HA")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("HA")%> </td><%end if%>
					<%
					if sEdit = 1 or strUser = "skriegel" then
					%>
						<td>
                        <input id="txtShipVia" name="txtShipVia"type="text" style="font-family: Verdana; font-size: 8pt; HEIGHT: 22px; WIDTH: 300px" value="<%=strShipVia%>" maxlength=50 size="20"></td>
					<%
					else
					%>
						<td><font FACE="Verdana" size=1><%=rs("SV")%> </td>
						<input type=hidden id="txtShipVia" name="txtShipVia" value="<%=rs("SV")%>">
					<%
					end if
					%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="20" name="txtDynamicsVendorCode" id="txtDynamicsVendorCode" value="<%=rs("DVC")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("DVC")%> </td><%end if%>
				</tr>
			</table>
			

		
			
			
			
			
			
			
			
			
			
			<table cellpadding=5 border=1>
				<tr>
					<th><font FACE="Verdana" size=1>Distributor</th>
					<th><font FACE="Verdana" size=1>Margin Rating</th>
					<th><font FACE="Verdana" size=1>Confirming Name</th>
					<th><font FACE="Verdana" size=1>Contract File Directory</th>
					<th><font FACE="Verdana" size=1>Purchasing Assingment Code</th>
				</tr>
				<tr>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><select size="1" name="txtDistributor">
														<option value="0" <%if rs("Distributor")=0 then%>SELECTED<%end if%>>False</option>
														<option value="-1" <%if rs("Distributor")=-1 then%>SELECTED<%end if%>>True</option>
													</select></td><%else%><td><font FACE="Verdana" size=1><%=rs("Distributor")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtMarginRating" id="txtMarginRating" value="<%=rs("MarginRating")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("MarginRating")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtConfirmingName" id="txtConfirmingName" value="<%=rs("ConfName")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ConfName")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtContractFileDirectory" id="txtContractFileDirectory" value="<%=rs("ContractFileDirectory")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ContractFileDirectory")%> </td><%end if%>
<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtRotationStatus" id="txtRotationStatus" value="<%=rs("RotationStatus")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("RotationStatus")%> </td><%end if%>
				</tr>
			</table>
			<%
			if sEdit = 1 or strUser = "jgardner" then
			%>
				<table cellpadding=5 border=1>
					<tr>
						<th><font size=1 face=Verdana>Opportunities Passed/Lost</font></th>
					</tr>
					<tr>
						<td><textarea id="txtOppPassLost" name="txtOppPassLost" style="HEIGHT: 50px; WIDTH: 705px; font-family: Verdana; font-size: 8pt" rows="1" cols="20"><%=rs("OpportunitiesPassedLost")%></textarea></td>
					</tr>
					<tr>
						<th><font size=1 face=Verdana>Vendor Notes</font></th>
					</tr>
					<tr>
						<td><textarea id="txtVendorNotes" name="txtVendorNotes" style="HEIGHT: 50px; WIDTH: 705px; font-family: Verdana; font-size: 8pt" rows="1" cols="20"><%=rs("VendorNotes")%></textarea></td>
					</tr>
					<tr>
						<th><font size=1 face=Verdana>Vendor Special Notes</font></th>
					</tr>
					<tr>
						<td><input type="text" id="txtVendorSpecialNotes" name="txtVendorSpecialNotes" value="<%=rs("VendorSpecialNotes")%>" style="font-family: Verdana; font-size: 8pt" maxlength="255" size="115"></td>
					</tr>										
				</table>			
				
			<%
			else
			%>
				<table cellpadding=5 border=1>
					<tr>
						<th><font FACE="Verdana" size=1>Opportunities Passed/Lost</th>
					</tr>
					<tr>
						<td><font FACE="Verdana" size=1><%=rs("OpportunitiesPassedLost")%> </td>
					</tr>
				</table>			
			<%
			end if
			%>
			<table cellpadding=5 border=1>
				<tr>
					<th><font FACE="Verdana" size=1>Jan</th>
					<th><font FACE="Verdana" size=1>Feb</th>
					<th><font FACE="Verdana" size=1>Mar</th>
					<th><font FACE="Verdana" size=1>Apr</th>
					<th><font FACE="Verdana" size=1>May</th>
					<th><font FACE="Verdana" size=1>Jun</th>
					<th><font FACE="Verdana" size=1>Jul</th>
					<th><font FACE="Verdana" size=1>Aug</th>
					<th><font FACE="Verdana" size=1>Sep</th>
					<th><font FACE="Verdana" size=1>Oct</th>
					<th><font FACE="Verdana" size=1>Nov</th>
					<th><font FACE="Verdana" size=1>Dec</th>
				</tr>
				<tr>
<%if sEdit=1 then%><td><select size="1" name="txtJan">
														<option value="0" <%if rs("VJan")=0 then%>SELECTED<%end if%>>False</option>
														<option value="-1" <%if rs("VJan")=-1 then%>SELECTED<%end if%>>True</option>
													</select></td><%else%><td><font FACE="Verdana" size=1><%=rs("VJan")%> </td><%end if%>
<%if sEdit=1 then%><td><select size="1" name="txtFeb">
														<option value="0" <%if rs("VFeb")=0 then%>SELECTED<%end if%>>False</option>
														<option value="-1" <%if rs("VFeb")=-1 then%>SELECTED<%end if%>>True</option>
													</select></td><%else%><td><font FACE="Verdana" size=1><%=rs("VFeb")%> </td><%end if%>
<%if sEdit=1 then%><td><select size="1" name="txtMar">
														<option value="0" <%if rs("VMar")=0 then%>SELECTED<%end if%>>False</option>
														<option value="-1" <%if rs("VMar")=-1 then%>SELECTED<%end if%>>True</option>
													</select></td><%else%><td><font FACE="Verdana" size=1><%=rs("VMar")%> </td><%end if%>
<%if sEdit=1 then%><td><select size="1" name="txtApr">
														<option value="0" <%if rs("VApr")=0 then%>SELECTED<%end if%>>False</option>
														<option value="-1" <%if rs("VApr")=-1 then%>SELECTED<%end if%>>True</option>
													</select></td><%else%><td><font FACE="Verdana" size=1><%=rs("VApr")%> </td><%end if%>
<%if sEdit=1 then%><td><select size="1" name="txtMay">
														<option value="0" <%if rs("VMay")=0 then%>SELECTED<%end if%>>False</option>
														<option value="-1" <%if rs("VMay")=-1 then%>SELECTED<%end if%>>True</option>
													</select></td><%else%><td><font FACE="Verdana" size=1><%=rs("VMay")%> </td><%end if%>
<%if sEdit=1 then%><td><select size="1" name="txtJun">
														<option value="0" <%if rs("VJun")=0 then%>SELECTED<%end if%>>False</option>
														<option value="-1" <%if rs("VJun")=-1 then%>SELECTED<%end if%>>True</option>
													</select></td><%else%><td><font FACE="Verdana" size=1><%=rs("VJun")%> </td><%end if%>
<%if sEdit=1 then%><td><select size="1" name="txtJul">
														<option value="0" <%if rs("VJul")=0 then%>SELECTED<%end if%>>False</option>
														<option value="-1" <%if rs("VJul")=-1 then%>SELECTED<%end if%>>True</option>
													</select></td><%else%><td><font FACE="Verdana" size=1><%=rs("VJul")%> </td><%end if%>
<%if sEdit=1 then%><td><select size="1" name="txtAug">
														<option value="0" <%if rs("VAug")=0 then%>SELECTED<%end if%>>False</option>
														<option value="-1" <%if rs("VAug")=-1 then%>SELECTED<%end if%>>True</option>
													</select></td><%else%><td><font FACE="Verdana" size=1><%=rs("VAug")%> </td><%end if%>
<%if sEdit=1 then%><td><select size="1" name="txtSep">
														<option value="0" <%if rs("VSep")=0 then%>SELECTED<%end if%>>False</option>
														<option value="-1" <%if rs("VSep")=-1 then%>SELECTED<%end if%>>True</option>
													</select></td><%else%><td><font FACE="Verdana" size=1><%=rs("VSep")%> </td><%end if%>
<%if sEdit=1 then%><td><select size="1" name="txtOct">
														<option value="0" <%if rs("VOct")=0 then%>SELECTED<%end if%>>False</option>
														<option value="-1" <%if rs("VOct")=-1 then%>SELECTED<%end if%>>True</option>
													</select></td><%else%><td><font FACE="Verdana" size=1><%=rs("VOct")%> </td><%end if%>
<%if sEdit=1 then%><td><select size="1" name="txtNov">
														<option value="0" <%if rs("VNov")=0 then%>SELECTED<%end if%>>False</option>
														<option value="-1" <%if rs("VNov")=-1 then%>SELECTED<%end if%>>True</option>
													</select></td><%else%><td><font FACE="Verdana" size=1><%=rs("VNov")%> </td><%end if%>
<%if sEdit=1 then%><td><select size="1" name="txtDec">
														<option value="0" <%if rs("VDec")=0 then%>SELECTED<%end if%>>False</option>
														<option value="-1" <%if rs("VDec")=-1 then%>SELECTED<%end if%>>True</option>
													</select></td><%else%><td><font FACE="Verdana" size=1><%=rs("VDec")%> </td><%end if%>
				</tr>
			</table>
			</form>
<%
rs.Close
set rs = nothing		

dbc.close
set dbc = nothing
%>
</body>
</html>
<script LANGUAGE="vbscript">
<!--	
	sub Go(sUrl)
		window.location = sUrl
	end sub
-->
</script>


An example of a textbox that is loosing data is this one:

<%if sEdit=1 then%><td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtAltShipCity" id="txtAltShipCity" value="<%=rs("ASCI")%>"></td><%else%><td><font FACE="Verdana" size=1><%=rs("ASCI")%> </td><%end if%>


The textbox is there, just appears blank.
TexasWebDevelopers

 

Posts: 720
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Data dissapears when changed to sql - 6/1/2009 14:32:25   
Declaring the values would be the correct way to go.

At a quick glance, is the problem only occurring with numerical "if... then... else... statements like this? <%if sEdit=1 then%>

Maybe the numeral is a string and you need to quote it?: <%if sEdit="1" then%>

On one or two fields you also might try changing the format from this:

<%=rs("ASCI")%>

to this:

<%=rs.Fields("ASCI").Value)%>

and see what happens.

_____________________________

:)

Follow us on TWITTER

(in reply to dzirkelb1)
dzirkelb1

 

Posts: 1433
Joined: 10/5/2004
From: Cedar Rapids, Iowa
Status: offline

 
RE: Data dissapears when changed to sql - 6/1/2009 14:41:17   
Neither approach seemed to work. The data is dissappearring in the textbox itself...so, I know the if then portion is working as if it wasn't, then it would not even show a text box.

(in reply to TexasWebDevelopers)
dzirkelb1

 

Posts: 1433
Joined: 10/5/2004
From: Cedar Rapids, Iowa
Status: offline

 
RE: Data dissapears when changed to sql - 6/1/2009 14:51:03   
This is very wierd...I tried the following things:

I tried making it <td><%=rs("ShipCity")%></td> and nothing
I tried making it <td><%=rs("VendorEmail")%></td> and it worked, changed it back to ShipCity and nothing
I tried renaming it in the sql query to ShipCity1 and got the item can't be found error
I changed it to <td><%=rs("ShipCity1")%></td> and nothing

I am very confused as to why this would be not working.

(in reply to dzirkelb1)
TexasWebDevelopers

 

Posts: 720
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Data dissapears when changed to sql - 6/1/2009 18:35:42   
quote:

<input style="font-family: Verdana; font-size: 8pt" size="10" name="txtAltShipCity" id="txtAltShipCity" value="<%=rs("ASCI")%>


Where are you specifying it's a text field?

Shouldn't it be:

quote:

<input type="text" style="font-family: Verdana; font-size: 8pt" size="10" name="txtAltShipCity" id="txtAltShipCity" value="<%=rs("ASCI")%>


You also have no DOCTYPE - that may be causing a number of display issues.

_____________________________

:)

Follow us on TWITTER

(in reply to dzirkelb1)
dzirkelb1

 

Posts: 1433
Joined: 10/5/2004
From: Cedar Rapids, Iowa
Status: offline

 
RE: Data dissapears when changed to sql - 6/2/2009 8:54:34   
I don't believe not defining the input as a text box is the issue as when I just try to display the info, it does not show either:

<td><%=rs("ShipCity")%></td>

returns a blank cell when it should give data.

(this is not my coding by the way, it is the old guy's, I find myself fixing his code on a lot of pages)

(in reply to TexasWebDevelopers)
TexasWebDevelopers

 

Posts: 720
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Data dissapears when changed to sql - 6/2/2009 9:38:35   
Well, at a certain point you can fiddle with this or simply code it correctly.
Declare AND assign the variables.
Use a DOCTYPE.
Code your input fields correctly.
Stick this at the top of your page:
<%@LANGUAGE=VBSCRIPT%>
<%Response.Buffer = True%>
Tips:
We almost always use adLockOptimistic like this, in your case:
rs.Open ssql, dbc, adOpenDynamic, adLockOptimistic
And we include the standard adovbs page (right under the @LANGUAGE):
<!--#include file="adovbs.inc"-->
To help with vbs coding.

There is a reason why "short-cut" coding is not always a good idea.



_____________________________

:)

Follow us on TWITTER

(in reply to dzirkelb1)
dzirkelb1

 

Posts: 1433
Joined: 10/5/2004
From: Cedar Rapids, Iowa
Status: offline

 
RE: Data dissapears when changed to sql - 6/2/2009 13:26:19   
It has something to do with the sql query itself as I can move items around inside the query, and then data will appear while other data will dissappear. Any ideas?

(in reply to dzirkelb1)
TexasWebDevelopers

 

Posts: 720
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Data dissapears when changed to sql - 6/2/2009 18:41:17   
Have you done a response.write(sql) to see what the db query really is?

_____________________________

:)

Follow us on TWITTER

(in reply to dzirkelb1)
Spooky

 

Posts: 26680
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Data dissapears when changed to sql - 6/2/2009 18:47:51   
If you view the OUTPUT html, what is the difference between what displays and what doesnt?

Typically there are issues with large text fields where if the values arent assigned to variables or displayed immediately you will loose them.

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to dzirkelb1)
dzirkelb1

 

Posts: 1433
Joined: 10/5/2004
From: Cedar Rapids, Iowa
Status: offline

 
RE: Data dissapears when changed to sql - 6/3/2009 8:41:24   
I have done a response.write(sql) and then ran the query in sql and it returns the correct results.

Viewing the source of the page outputs:

<td><font FACE="Verdana" size=1><input style="font-family: Verdana; font-size: 8pt" size="10" name="txtDropShipment" id="txtDropShipment" value=""></td>

When the value should have something in it.

(in reply to Spooky)
TexasWebDevelopers

 

Posts: 720
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Data dissapears when changed to sql - 6/3/2009 11:15:30   
Spooky and I are saying the same thing--declare (DIM) and assign values to the variables or you risk not having the data displayed properly.
<%
DIM ShipCity
ShipCity=trim(rs("ShipCity"))
%>

_____________________________

:)

Follow us on TWITTER

(in reply to dzirkelb1)
dzirkelb1

 

Posts: 1433
Joined: 10/5/2004
From: Cedar Rapids, Iowa
Status: offline

 
RE: Data dissapears when changed to sql - 6/3/2009 11:37:11   
I don't understand why this is taking place though, I have many, many more pages that display a lot more information that works fine. I can definately assign variables, it will just be a pain in the butt.

(in reply to TexasWebDevelopers)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> Data dissapears when changed to sql
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts