Ask a Question related to ASP Database, Design and Development.
-
chan #1
HElp urgent ! connection conflict in the UPdate function
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Shipment Description</title>
<script language="javascript">
function PopUp(ref)
{
var strFeatures="toolbar=no,status=no,menubar=no,locat ion=no"
strFeatures=strFeatures+",scrollbars=no,resizable= yes,height=320,width=620"
newWin = window.open(ref,"TellObj",strFeatures);
newWin.opener = Left;
}
</script>
</head>
<style>
.label { font-family:arial; font-size:8pt; font-color:blue }+
</style>
</SCRIPT><FORM Name=frmMain METHOD='POST' ACTION='imcdbStartTable.asp'>
<body>
<%
Function GetAllData(cnn)
Dim rs
Dim SQL
Dim str
Dim rowNum
Dim Count
SQL="Select distinct a.CustomerReference,"
SQL= SQL & "a.Description2,isnull(a.PONum,'NULL') As
PONum,a.QtyShipped,a.ShipMethod,"
SQL= SQL & "a.ShipDate,isnull(a.HAWB,'NULL') As HAWB,isnull(a.MAWB,'NULL')
As MAWB,"
SQL= SQL & "b.ETDDate,b.ETAFCZ,b.FlightDetails,"
SQL= SQL & "(a.QtyShipped-sum(c.ReceivedQty))As BalanceQty "
SQL= SQL & "From tblimcdb_v a inner join tblUserDefine2 b on
a.CustomerReference=b.CustomerReference "
SQL= SQL & "inner join tblSubimcdb c on
b.CustomerReference=c.CustomerReference "
SQL= SQL & "group by
a.CustomerReference,a.Description2,a.PONum,a.ShipM ethod,a.HAWB,a.MAWB,"
SQL= SQL &
"b.ETDDate,b.ETAFCZ,b.FlightDetails,a.ShipDate,a.Q tyShipped,BalanceQty"
SQL= SQL & " having (QtyShipped-sum(c.ReceivedQty))>0"
Set rs=CreateObject("ADODB.Recordset")
rs.ActiveConnection=cnn
rs.Open SQL
rowNum=0
While Not rs.EOF
str= str & "<TR bgcolor='#BBFAFF' >"
str= str & "<TD><span class='label'>"
str= str & rowNum & "</span></TD>"
str= str & "<TD><span class='label'>"
str= str & rs("Description2") & "</span></TD>"
str= str & "<TD><span class='label'>"
str= str & rs("PONum") & "</span></TD>"
str= str & "<TD><span class='label'>"
str= str & "<INPUT Name='txtCustomerReference" & rowNum & "' value= '" &
rs("CustomerReference")& "' font size='8' ></span></TD>"
str= str & "<TD><span class='label'>"
str= str & rs("QtyShipped") & "</span></TD>"
str= str & "<TD><span class='label'>"
str= str & rs("ShipMethod") & "</span></TD>"
str= str & "<TD><span class='label'>"
str= str & rs("ShipDate") & "</span></TD>"
str= str & "<TD><span class='label'>"
str= str & "<INPUT Name='txtETDDate" & rowNum & "' Height='30' value= '" &
rs("ETDDate")& "' font size='8' ></span></TD>"
str= str & "<TD><span class='label'>"
str= str & rs("HAWB") & "</span></TD>"
str= str & "<TD><span class='label'>"
str= str & rs("MAWB") & "</span></TD>"
str= str & "<TD><span class='label'>"
str= str & "<INPUT Name='txtETAFCZ" & rowNum & "' Height='30' value= '" &
rs("ETAFCZ")& "' font size='8'></span></TD>"
str= str & "<TD><span class='label'>"
str= str & "<TEXTAREA Name='txtFD" & rowNum & "' rows='2' cols='15'
Height='10' font size='8' > " & rs("FlightDetails")&
"</TEXTAREA></span></TD>"
str= str & "<TD><span class='label'>"
str= str & rs("BalanceQty") & "</span></TD>"
str= str & "<TD><span class='label'>"
'str= str & "<p><a target='_blank' href='StratSubForm.asp'><img
src='Arrow.gif'></span></TD></a></p>"
'str= str & "<p><a href='JavaScript:PopUp('StratSubForm.asp')'><img
src='Arrow.gif'></span></TD></a></p>"
str = str & "<p><a href=" & CHR(034) &
"JavaScript:PopUp('StratSubForm.asp')" & CHR(034) & "><img
src='Arrow.gif'></span></ TD></a></p>"
str= str & "</TR>"
rowNum=rowNum+1
rs.moveNext
Wend
GetAllData=str
End Function
Function Update(cnn,CustomerReference2,ETDDate2,ETAFCZ2,Fli ghtDetails2)
Dim SQL
Dim cmd
Dim i
SQL=SQL & "If '" & CustomerReference2 & "'=(select CustomerReference from
tblUserDefine2 where CustomerReference= '" & CustomerReference2 & "' Group
by CustomerReference) begin "
SQl=SQL & "update tblUserDefine2 "
SQL= SQL & "set ETDDate='" & ETDDate2 & "', ETAFCZ='" & ETAFCZ2 &
"',FlightDetails='" & FlightDetails2 & "' "
SQL= SQL & " where CustomerReference= '" & CustomerReference2 & "' "
SQL= SQL & " end "
SQL= SQL & "else begin "
SQL= SQL & "INSERT INTO tblUserDefine2 "
SQL= SQL &
"(tblUserDefine2.CustomerReference,tblUserDefine2. ETDDate,tblUserDefine2.ETA
FCZ,FlightDetails)"
SQL= SQL & " VALUES ('"
SQL= SQL & CustomerReference2 & "', '"
SQL= SQL & ETDDate2 & "', '"
SQL= SQL & ETAFCZ2 & "', '"
SQL= SQL & FlightDetails2 & "')"
SQL= SQL & "end"
Set cmd=CreateObject("ADODB.Command")
cmd.CommandText= SQL
cmd.ActiveConnection=cnn
cmd.Execute
Set cmd.ActiveConnection=Nothing
Set cmd = Nothing
Update=True
Exit Function
On Error Resume Next
Update=False
End Function
Dim i
Dim ETDDate2
Dim ETAFCZ2
Dim FlightDetails2
Dim CustomerReference2
Dim Count
Dim str
Dim cnn
Count=Request.form.count
'i=0
For i=0 to Count
CustomerReference2=Request.Form( "txtCustomerReference" & i )
ETDDate2=Request.Form("txtETDDate" & i )
ETAFCZ2=Request.Form("txtETAFCZ" & i)
FlightDetails2=Request.Form("txtFD" & i )
Call Update(cnn,CustomerReference2,ETDDate2,ETAFCZ2,Fli ghtDetails2)
Next
Set cnn=CreateObject("ADODB.Connection")
str="Data Source=imcdb;"
str= str & "User ID=imcdb_admin;Password=imcdb;"
cnn.Open str
If Update(cnn,CustomerReference2,ETDDate2,ETAFCZ2,Fli ghtDetails2) Then
Response.write"<TABLE Border=3 Width='1100' Height='4' bordercolor=blue
bgcolor='#BBFAFF'>"
Response.write"<col Height='0.5%' col width='2%' col width='5%' col
width='5%' col width='10%' col width='10%' col width='3%' col width='10%'col
width='5%'col width='2%' col width='2%' col width='5%' col width='2%' col
width='5%' col width='5%'>"
Response.write"<TH>"
Response.write"<span class='label'>"
Response.write"NO.</span></TH>"
Response.write"<TH>"
Response.write"<span class='label'>"
Response.write"Cisco model</span></TH>"
Response.write"<TH>"
Response.write"<span class='label'>"
Response.write"Cisco PO#</span></TH>"
Response.write"<TH>"
Response.write"<span class='label'>"
Response.write"Packing Slip</span></TH>"
Response.write"<TH>"
Response.write"<span class='label'>"
Response.write"Ship Qty</span></TH>"
Response.write"<TH>"
Response.write"<span class='label'>"
Response.write"Ship Method(S/A)</span></TH>"
Response.write"<TH>"
Response.write"<span class='label'>"
Response.write"Ex Factory Date</span></TH>"
Response.write"<TH>"
Response.write"<span class='label'>"
Response.write"ETD Date</span></TH>"
Response.write"<TH>"
Response.write"<span class='label'>"
Response.write"HAWB</span></TH>"
Response.write"<TH>"
Response.write"<span class='label'>"
Response.write"MAWB</span></TH>"
Response.write"<TH>"
Response.write"<span class='label'>"
Response.write"ETA FCZ</span></TH>"
Response.write"<TH>"
Response.write"<span class='label'>"
Response.write"Flight Details</span></TH>"
Response.write"<TH>"
Response.write"<span class='label'>"
Response.write"Balance to Receive</span></TH>"
Response.write"<TH>"
Response.write"<span class='label'>"
Response.write"Link</span></TH>"
Response.write GetAllData(cnn)
Response.write "</TABLE>"
Response.write"</FONT>"
Else
Response.write "<FONT COLOR=Red Size=5 FACE=ARIAL>"
Response.write "update failed! "
Response.write "</FONT>"
End if
'i=i+1
cnn.Close
%>
<INPUT Name='Submit' Type='submit' Value=' Update ' ></FORM>
</body>
</html>
chan Guest
-
#40703 [NEW]: PHP 5.2.1 - MySQL 5.2.3 - Internal Function Conflict in base64.h
From: sietse at wizdom dot nu Operating system: All PHP version: 5.2.1 PHP Bug Type: XMLRPC-EPI related Bug description: ... -
OLE DB Connection HELP ME - URGENT
Every time I try to make an ole db connection, when I press the "Test" button apears the next message: "Unspecified Error" What can I do to kill... -
Update statistics suggestions --Urgent
Hi I have a database with around 80 to 90 tables , and cron job is running for UPDATE STATS "update statistics high " runs every night on... -
URGENT: Automate an update
Hi all, I need help in order to create a following "mechanism". I have a table where is a column called window_open and it has two values 'Y'... -
Suse 8.0 Update / XFree86 Conflict?
Thanks in advance for any help (and yes, I've spent hours doing Google and Suse searches for answers). I have a Suse 8.0 installation on a laptop... -
Mark Schupp #2
Re: HElp urgent ! connection conflict in the UPdate function
error message? explanation of problem? short example with same problem?
--
Mark Schupp
Head of Development
Integrity eLearning
[url]www.ielearning.com[/url]
"chan" <ccl555@hotmail.com> wrote in message
news:el4GimnaEHA.2792@TK2MSFTNGP09.phx.gbl...strFeatures=strFeatures+",scrollbars=no,resizable= yes,height=320,width=620"> <html>
>
> <head>
> <meta http-equiv="Content-Language" content="en-us">
> <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
> <meta name="ProgId" content="FrontPage.Editor.Document">
> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
> <title>Shipment Description</title>
> <script language="javascript">
> function PopUp(ref)
> {
> var strFeatures="toolbar=no,status=no,menubar=no,locat ion=no"
>&>
> newWin = window.open(ref,"TellObj",strFeatures);
> newWin.opener = Left;
> }
>
> </script>
> </head>
> <style>
> .label { font-family:arial; font-size:8pt; font-color:blue }+
> </style>
> </SCRIPT><FORM Name=frmMain METHOD='POST' ACTION='imcdbStartTable.asp'>
> <body>
>
>
> <%
>
> Function GetAllData(cnn)
> Dim rs
> Dim SQL
> Dim str
> Dim rowNum
> Dim Count
>
> SQL="Select distinct a.CustomerReference,"
> SQL= SQL & "a.Description2,isnull(a.PONum,'NULL') As
> PONum,a.QtyShipped,a.ShipMethod,"
> SQL= SQL & "a.ShipDate,isnull(a.HAWB,'NULL') As HAWB,isnull(a.MAWB,'NULL')
> As MAWB,"
> SQL= SQL & "b.ETDDate,b.ETAFCZ,b.FlightDetails,"
> SQL= SQL & "(a.QtyShipped-sum(c.ReceivedQty))As BalanceQty "
> SQL= SQL & "From tblimcdb_v a inner join tblUserDefine2 b on
> a.CustomerReference=b.CustomerReference "
> SQL= SQL & "inner join tblSubimcdb c on
> b.CustomerReference=c.CustomerReference "
> SQL= SQL & "group by
> a.CustomerReference,a.Description2,a.PONum,a.ShipM ethod,a.HAWB,a.MAWB,"
> SQL= SQL &
> "b.ETDDate,b.ETAFCZ,b.FlightDetails,a.ShipDate,a.Q tyShipped,BalanceQty"
> SQL= SQL & " having (QtyShipped-sum(c.ReceivedQty))>0"
>
>
> Set rs=CreateObject("ADODB.Recordset")
>
> rs.ActiveConnection=cnn
>
> rs.Open SQL
>
> rowNum=0
>
> While Not rs.EOF
>
> str= str & "<TR bgcolor='#BBFAFF' >"
> str= str & "<TD><span class='label'>"
> str= str & rowNum & "</span></TD>"
> str= str & "<TD><span class='label'>"
> str= str & rs("Description2") & "</span></TD>"
> str= str & "<TD><span class='label'>"
> str= str & rs("PONum") & "</span></TD>"
> str= str & "<TD><span class='label'>"
> str= str & "<INPUT Name='txtCustomerReference" & rowNum & "' value= '" &
> rs("CustomerReference")& "' font size='8' ></span></TD>"
> str= str & "<TD><span class='label'>"
> str= str & rs("QtyShipped") & "</span></TD>"
> str= str & "<TD><span class='label'>"
> str= str & rs("ShipMethod") & "</span></TD>"
> str= str & "<TD><span class='label'>"
> str= str & rs("ShipDate") & "</span></TD>"
> str= str & "<TD><span class='label'>"
> str= str & "<INPUT Name='txtETDDate" & rowNum & "' Height='30' value= '"from> rs("ETDDate")& "' font size='8' ></span></TD>"
> str= str & "<TD><span class='label'>"
> str= str & rs("HAWB") & "</span></TD>"
> str= str & "<TD><span class='label'>"
> str= str & rs("MAWB") & "</span></TD>"
> str= str & "<TD><span class='label'>"
> str= str & "<INPUT Name='txtETAFCZ" & rowNum & "' Height='30' value= '" &
> rs("ETAFCZ")& "' font size='8'></span></TD>"
> str= str & "<TD><span class='label'>"
> str= str & "<TEXTAREA Name='txtFD" & rowNum & "' rows='2' cols='15'
> Height='10' font size='8' > " & rs("FlightDetails")&
> "</TEXTAREA></span></TD>"
> str= str & "<TD><span class='label'>"
> str= str & rs("BalanceQty") & "</span></TD>"
> str= str & "<TD><span class='label'>"
> 'str= str & "<p><a target='_blank' href='StratSubForm.asp'><img
> src='Arrow.gif'></span></TD></a></p>"
> 'str= str & "<p><a href='JavaScript:PopUp('StratSubForm.asp')'><img
> src='Arrow.gif'></span></TD></a></p>"
> str = str & "<p><a href=" & CHR(034) &
> "JavaScript:PopUp('StratSubForm.asp')" & CHR(034) & "><img
> src='Arrow.gif'></span></ TD></a></p>"
> str= str & "</TR>"
>
> rowNum=rowNum+1
> rs.moveNext
> Wend
> GetAllData=str
> End Function
>
>
>
> Function Update(cnn,CustomerReference2,ETDDate2,ETAFCZ2,Fli ghtDetails2)
> Dim SQL
> Dim cmd
> Dim i
>
>
> SQL=SQL & "If '" & CustomerReference2 & "'=(select CustomerReference"(tblUserDefine2.CustomerReference,tblUserDefine2. ETDDate,tblUserDefine2.ETA> tblUserDefine2 where CustomerReference= '" & CustomerReference2 & "' Group
> by CustomerReference) begin "
> SQl=SQL & "update tblUserDefine2 "
> SQL= SQL & "set ETDDate='" & ETDDate2 & "', ETAFCZ='" & ETAFCZ2 &
> "',FlightDetails='" & FlightDetails2 & "' "
> SQL= SQL & " where CustomerReference= '" & CustomerReference2 & "' "
> SQL= SQL & " end "
> SQL= SQL & "else begin "
> SQL= SQL & "INSERT INTO tblUserDefine2 "
> SQL= SQL &
>width='10%'col> FCZ,FlightDetails)"
> SQL= SQL & " VALUES ('"
> SQL= SQL & CustomerReference2 & "', '"
> SQL= SQL & ETDDate2 & "', '"
> SQL= SQL & ETAFCZ2 & "', '"
> SQL= SQL & FlightDetails2 & "')"
> SQL= SQL & "end"
>
> Set cmd=CreateObject("ADODB.Command")
>
> cmd.CommandText= SQL
> cmd.ActiveConnection=cnn
> cmd.Execute
>
>
> Set cmd.ActiveConnection=Nothing
> Set cmd = Nothing
>
>
> Update=True
> Exit Function
> On Error Resume Next
> Update=False
> End Function
>
> Dim i
> Dim ETDDate2
> Dim ETAFCZ2
> Dim FlightDetails2
> Dim CustomerReference2
> Dim Count
> Dim str
> Dim cnn
>
>
>
> Count=Request.form.count
> 'i=0
> For i=0 to Count
> CustomerReference2=Request.Form( "txtCustomerReference" & i )
> ETDDate2=Request.Form("txtETDDate" & i )
> ETAFCZ2=Request.Form("txtETAFCZ" & i)
> FlightDetails2=Request.Form("txtFD" & i )
> Call Update(cnn,CustomerReference2,ETDDate2,ETAFCZ2,Fli ghtDetails2)
> Next
>
>
>
> Set cnn=CreateObject("ADODB.Connection")
> str="Data Source=imcdb;"
> str= str & "User ID=imcdb_admin;Password=imcdb;"
>
>
>
> cnn.Open str
> If Update(cnn,CustomerReference2,ETDDate2,ETAFCZ2,Fli ghtDetails2) Then
>
> Response.write"<TABLE Border=3 Width='1100' Height='4' bordercolor=blue
> bgcolor='#BBFAFF'>"
> Response.write"<col Height='0.5%' col width='2%' col width='5%' col
> width='5%' col width='10%' col width='10%' col width='3%' col> width='5%'col width='2%' col width='2%' col width='5%' col width='2%' col
> width='5%' col width='5%'>"
> Response.write"<TH>"
> Response.write"<span class='label'>"
> Response.write"NO.</span></TH>"
> Response.write"<TH>"
> Response.write"<span class='label'>"
> Response.write"Cisco model</span></TH>"
> Response.write"<TH>"
> Response.write"<span class='label'>"
> Response.write"Cisco PO#</span></TH>"
> Response.write"<TH>"
> Response.write"<span class='label'>"
> Response.write"Packing Slip</span></TH>"
> Response.write"<TH>"
> Response.write"<span class='label'>"
> Response.write"Ship Qty</span></TH>"
> Response.write"<TH>"
> Response.write"<span class='label'>"
> Response.write"Ship Method(S/A)</span></TH>"
> Response.write"<TH>"
> Response.write"<span class='label'>"
> Response.write"Ex Factory Date</span></TH>"
> Response.write"<TH>"
> Response.write"<span class='label'>"
> Response.write"ETD Date</span></TH>"
> Response.write"<TH>"
> Response.write"<span class='label'>"
> Response.write"HAWB</span></TH>"
> Response.write"<TH>"
> Response.write"<span class='label'>"
> Response.write"MAWB</span></TH>"
> Response.write"<TH>"
> Response.write"<span class='label'>"
> Response.write"ETA FCZ</span></TH>"
> Response.write"<TH>"
> Response.write"<span class='label'>"
> Response.write"Flight Details</span></TH>"
> Response.write"<TH>"
> Response.write"<span class='label'>"
> Response.write"Balance to Receive</span></TH>"
> Response.write"<TH>"
> Response.write"<span class='label'>"
> Response.write"Link</span></TH>"
> Response.write GetAllData(cnn)
> Response.write "</TABLE>"
> Response.write"</FONT>"
> Else
> Response.write "<FONT COLOR=Red Size=5 FACE=ARIAL>"
> Response.write "update failed! "
> Response.write "</FONT>"
> End if
> 'i=i+1
>
> cnn.Close
>
>
> %>
>
>
> <INPUT Name='Submit' Type='submit' Value=' Update ' ></FORM>
>
>
> </body>
>
> </html>
>
>
>
Mark Schupp Guest



Reply With Quote

