viewing different tables accornig to form
i wrote a program that gets that gets 26 parameters and according to the form enetery but it doesn't work
my program is as below:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="3,2,1"
MM_authFailedURL="login.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthor ization"))>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL")
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%>
<%
Dim rs
Dim rs_numRows
Dim rs_MMColParam
MMColParam = Request.Form("SiteWorkshop")
Dim rs_MMColParam1
MMColParam1 = Request.Form("UnitNo")
Dim rs_MMColParam2
MMColParam2 = Request.Form("HGNo")
Dim rs_MMColparam3
MMColParam3 = Request.Form("HGResponsible")
Dim rs_myarray4
myarray4 = Request.Form("Supplier")
Dim rs_myarray5
myarray5 = Request.Form("ScopeOfWork")
Dim rs_myarray6
myarray6 = Request.Form("YesNo")
Dim rs_myarray7
myarray7 = Request.Form("BaseLineDeliveryDateToIran")
Dim rs_myarray8
myarray8 = Request.Form("Location")
Dim rs_myarray9
myarray9 = Request.Form("ActualDeliveryDateToIranCustom")
Dim rs_myarray10
myarray10 = Request.Form("CustomsClearance")
Dim rs_myarray11
myarray11 = Request.Form("Contract")
Dim rs_myarray12
myarray12 = Request.Form("EarliestNeeded")
Dim rs_myarray13
myarray13 = Request.Form("LatestNeeded")
Dim rsmyarray14
myarray14 = Request.Form("ManufactureStart")
Dim rs_myarray15
myarray15 = Request.Form("Duration")
Dim rs_myarray16
myarray16 = Request.Form("ManufactureEnd")
Dim rs_myarray17
myarray17 = Request.Form("ActualProgress")
Dim rs_myarray18
myarray18 = Request.Form("PlannedProgress")
Dim rs_myarray19
myarray19 = Request.Form("Variance")
Dim rs_myarray20
myarray20 = Request.Form("Delay")
Dim rs_myarray21
myarray21 = Request.Form("LocationOfHG")
Dim rs_myarray22
myarray22 = Request.Form("Remark")
Dim rs_myarray23
myarray23 = Request.Form("Released")
Dim rs_myarray24
myarray24 = Request.Form("SiemenseReleaseNote")
Dim rs_myarray25
myarray25 = Request.Form("SGSFinalApproval")
Dim myarry(23),index
myarry = array("myarray3","myarray4","myarray5","myarray6", "myarray7","myarray8","myarray9","myarray10","myar ray11","myarray12","myarray13","myarray14","myarra y15","myarray16","myarray17","myarray18","myarray1 9","myarray20","myarray21","myarray22","myarray23" ,"myarray24","myarray25")
%>
<%
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_QCcon_STRING
rs.Source = "SELECT * FROM dbo.tbHGInf WHERE SiteWorkshop = '%" + Replace(rs__MMColParam, "'", "''") + "%' AND UnitNo = '%" + Replace(rs__MMColParam1, "'", "''") + "%' AND HGNo = '%" + Replace(rs__MMColParam2, "'", "''") + "%'"
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()
rs_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rs_numRows = rs_numRows + Repeat1__numRows
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth
Dim MM_removeList
Dim MM_item
Dim MM_nextItem
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>HG Information View</title>
<style type="text/css">
<!--
body,td,th {
color: #000033;
}
body {
background-color: #fdfeff;
background-image: url(back.jpg);
}
.style1 {
font-size: x-large;
font-style: italic;
font-weight: bold;
}
.style2 {
color: #FFFFFF;
font-style: italic;
font-weight: bold;
}
-->
</style>
</head>
<body><table width="709" border="0" align="center">
<tr>
<td width="768" background="OTC.jpg"><table width="709" border="0" align="center">
<tr>
<td width="751" align="left"><img src="ban2.jpg" width="709" height="179">
<table width="709" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="420"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="420" height="30">
<param name="movie" value="link40.swf">
<param name="quality" value="high">
<embed src="link40.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="420" height="30"></embed>
</object></td>
<td width="279" align="left"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="140" height="30">
<param name="movie" value="link13.swf">
<param name="quality" value="high">
<embed src="link13.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="140" height="30"></embed>
</object></td>
</tr>
</table></td>
</tr>
<tr>
<td><span class="style1"><br>
<img src="icon_folder_new_topic.gif" width="15" height="15">HG Information </span></td>
</tr>
<tr>
<td><table border="0" align="center">
<tr align="center" bgcolor="#000033">
<td><span class="style2">Row</span></td>
<td><span class="style2">Site /Workshop </span></td>
<td><span class="style2">UnitNo</span></td>
<td><span class="style2">HGNo</span></td>
<td><span class="style2">HGName</span></td>
<%Dim i,s
i = 0
While i < 23
if myarry(i) = "1" then
select Case i
Case "0"
s="HG Responsible"
case "1"
s="Supplier"
Case "2"
s="ScopeOfWork"
Case "3"
s="Yes / No"
Case"4"
s="BaseLine Delivery Date To Iran"
Case "5"
s="Location"
Case "6"
s="Actual Delivery Date To Iran Custom"
Case "7"
s="Customs Clearance"
Case "8"
s="Contract"
Case "9"
s="Earliest Needed"
Case "10"
s="Latest Needed"
Case "11"
s="Start"
Case "12"
s="Duration"
Case "13"
s="End"
Case "14"
s="Actual Progress"
Case "15"
s="Planned Progress(Baseline)"
Case "16"
s="Variance(Planned & Actual)"
Case "17"
s="Delay"
Case "18"
s="Location Of HG"
Case "19"
s="Remark"
Case "20"
s="Released"
Case "21"
s="Siemense Release Note"
Case "22"
s="SGS Final Approval"
End Select
%>
<td><% Response.Write(s)%></td>
<%
i = i + 1
end if
wend%>
<td> </td>
<td> </td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rs.EOF))
%>
<tr align="center">
<td><%=(rs.Fields.Item("Row").Value)%></td>
<td><%=(rs.Fields.Item("SiteWorkshop").Value)%></td>
<td><%=(rs.Fields.Item("UnitNo").Value)%></td>
<td><%=(rs.Fields.Item("HGNo").Value)%></td>
<td><%=(rs.Fields.Item("HGName").Value)%></td>
<%Dim s1
i = 0
While i< 23
if myarry(i)= "1" then
select Case i
Case "0"
s1="HGResponsible"
case "1"
s1="Supplier"
Case "2"
s1="ScopeOfWork"
Case "3"
s1="YesNo"
Case"4"
s1="BaseLineDeliveryDateToIran"
Case "5"
s1="Location"
Case "6"
s1="ActualDeliveryDateToIranCustom"
Case "7"
s1="CustomsClearance"
Case "8"
s1="Contract"
Case "9"
s1="EarliestNeeded"
Case "10"
s1="LatestNeeded"
Case "11"
s1="ManufactureStart"
Case "12"
s1="Duration"
Case "13"
s1="ManufactureEnd"
Case "14"
s1="ActualProgress"
Case "15"
s1="PlannedProgress"
Case "16"
s1="Variance"
Case "17"
s1="Delay"
Case "18"
s1="LocationOfHG"
Case "19"
s1="Remark"
Case "20"
s1="Released"
Case "21"
s1="SiemenseReleaseNote"
Case "22"
s1="SGSFinalApproval"
End Select%>
<td><%rs.Fields.Item(s1).value%> </td>
<% end if
wend%>
<td><em><A HREF="HGinfupdate.asp?<%= Server.HTMLEncode(MM_keepURL) & MM_joinChar(MM_keepURL) & "Row=" & rs.Fields.Item("Row").Value %>">Update</A></em></td>
<td><em><A HREF="HGinfdelete.asp?<%= Server.HTMLEncode(MM_keepURL) & MM_joinChar(MM_keepURL) & "Row=" & rs.Fields.Item("Row").Value %>">Delete</A></em></td>
</tr>
<tr>
<td colspan="8"></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs.MoveNext()
Wend
%>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<%
rs.Close()
Set rs = Nothing
%>
please hepl me to fix it
|