kuchiv
01-09-2003, 08:00 AM
<%
Dim str
Dim strSql
Set common = CreateObject("IQMS.Common")
Set conn = CreateObject("ADODB.Connection")
Set iCon = CreateObject("iKnow.iControl")
'Recordset for generating the other information
Set dt = CreateObject("ADODB.Recordset")
'This recordset is specially for Issues
'Set dt1 = CreateObject ("ADODB.Recordset")
'Recordset For generating the complaint details
'Set dt1= CreateObject ("ADODB.Recordset")
conn.Open ConnectionString
iCon.OpenDB ConnectionString
start = 1
</body>
</html>
<%
sub doList
%>
<%=iPub.Component.Styles.STYLEHTML%>
<title><%=iPub%> - <%=iPub.Component%></title>
</head>
<body <%=iPub.Component.BODY%>>
<%
Response.write iPub.Component.TitleBar(iPub.Component.Captions("Customers List"),0)
Response.Write pagetablestart()
showhelptext "QCustomerList.asp","Customer Listing"
Response.Buffer=TRUE
Response.Flush
SQL = "select review_item.revrec_itemcode, customer.cust_name, customer.cust_contact_name, customer.cust_phone, customer.cust_fax, review_item.revrec_type from customer, review_item where customer.cust_code = review_item.revrec_itemcode order by customer.cust_code"
dt.Open SQL, Conn,1,1
if dt.eof then response.redirect request.servervariables("revrec_itemcode")
dt.MoveFirst
<br>
<table>
<tr>
<td>
<form name=delform id=delform action="QCustomerList.asp">
<%=extrastring%>
<input type="hidden" name="mode" value="delete">
<table border=1 class="inputtable" width="100%" align="center" id=table1>
<!--Just counting the numb<A HREF="file://C:\WINDOWS\Application Data\Microsoft\Internet Explorer\Quick Launch\Launch Internet Explorer Browser.lnk">file://C:\WINDOWS\Application Data\Microsoft\Internet Explorer\Quick Launch\Launch Internet Explorer Browser.lnk</A>er of customer complaints available-->
<TR><TH CLASS=inforow colspan=2> There are <%=dt.recordcount & " "%>
<%=ipub.Component.Captions("customer(s)")%> found.</th></tr>
<tr><td class="evenrow" colspan=2> </td></tr>
<tr><td class="evenrow" colspan=2>
<li>Click <a HREF="QCustomerCreate.asp?<%=ExtraStr%>">here</a> to create new customer.</li>
</td></tr><br>
<tr><td class="evenrow" colspan=2>
<li>Click <a href="" onclick="if (confirm('Are you sure you want to delete the selected records?')) { delform.submit();} return false;">here</a> to delete selected records.</li>
</Td></tr>
<tr><td class="evenrow" colspan=2> </td></tr>
<tr>
<td class="evenrow" style="width:30px"> </td>
<td class="evenrow">
<table class="listtable" width="100%" align="left">
<tr>
<td class="headrow" colspan=2 align="center">No.</td>
<td class="headrow" colspan=4 align="center">Customer Code</td>
<td class="headrow" colspan=4 align="center">Customer Name</td>
<td class="headrow" colspan=4 align="center">Contact Person</td>
<td class="headrow" colspan=2 align="center">Phone</td>
<td class="headrow" colspan=2 align="center">Fax</td>
<td class="headrow" colspan=2 align="center">Delete</td>
<td align="centre" class="headrow" colspan=2>Issues</td>
</tr>
dt.MoveFirst
if not dt.EOF then
str = dt("revrec_itemcode")
%>
<td class="evenrow" COLSPAN=2 width="5%">
<%=start%>
<td class="evenrow" colspan=4 width="10%" align="center"><a HREF="QCustomerDetail.asp?<%=ExtraStr%>&ccode=<%=common.ConvertSpecialCharacters(dt("revrec_itemcode"))%>"><%=dt("revrec_itemcode")%></a></td>
<td class="evenrow" colspan=4 width="10%" align="center"><%=dt("cust_name")%></td>
<td class="evenrow" colspan=4 width="10%" align="center"><%=dt("cust_contact_name")%></td>
<td class="evenrow" colspan=2 width="10%" align="center"><%=dt("cust_phone")%></td>
<td class="evenrow" colspan=2 width="10%" align="center"><%=dt("cust_fax")%></td>
<td class="evenrow" align="center" colspan=2 width="10%" align="center"><center><input type="checkbox" id="chkd" name="chkd" value="<%=common.ConvertSpecialCharacters(sid)%>"></center></td>
<%
set tempDt = conn.Execute ("select revrec_type from review_item, customer where customer.cust_code=review_item.revrec_itemcode group by revrec_type;")
Response.Write "created"
strSql = "select revrec_type from review_item, customer where customer.cust_code=review_item.revrec_itemcode group by revrec_type;"
tempDt.Open strSql, Conn,1,1
tempDt.MoveNext
while not tempDt.EOF
%>
<td class="evenrow" colspan=2 width="5%" align="center"><a href="QCustomerCalls.asp"><%=tempDt("revrec_type")%><%=start%></a><%start = start + 1%>
<%
tempdt.MoveNext
wend
%>
</td>
</tr>
<%
end if
%>
</tr>
<!--<table>
<tr>
<td>-->
<!--<a HREF="QCustomerDetail.asp?
<%Response.Write "ExtraStr:" & ExtraStr%>&rcode=<%'=common.ConvertSQLSpecialCharacters(dt1("revrec_itemcode"))%>">
</td></tr>
</table>-->
<%'loop%>
<!--<form name=delform id=delform action="QCustomerList.asp">
<%=extrastring%>
<input type="hidden" name="mode" value="delete">
<table border=1 class="inputtable" width="95%" align="center" id=table1>
<!--Just counting the number of customer complaints available-->
<!--<TR><TH CLASS=inforow colspan=2> There are <%=dt.recordcount & " "%> <%=ipub.Component.Captions("customer(s)")%> found.</th></tr>
<tr><td class="evenrow" colspan=2> </td></tr>
<tr><td class="evenrow" colspan=2>
<li>Click <a HREF="QCustomerCreate.asp?<%=ExtraStr%>">here</a> to create new customer.</li>
</td></tr><br>
<tr><td class="evenrow" colspan=2>
<li>Click <a href="" onclick="if (confirm('Are you sure you want to delete the selected records?')) { delform.submit();} return false;">here</a> to delete selected records.</li>
</Td></tr>
<tr><td class="evenrow" colspan=2> </td></tr>
<tr>
<td class="evenrow" style="width:30px"> </td>
<td class="evenrow">
<table class="listtable" width="95%" align="left">
<tr>
<td class="headrow" COLSPAN=6>No.</td>
<td class="headrow">Customer Code</td>
<td class="headrow">Customer Name</td>
<td class="headrow">Contact Person</td>
<td class="headrow">Phone</td>
<td class="headrow">Fax</td>
<td class="headrow">Delete</td>
<td align=center class="headrow">Issues</td>
</tr>
<tr>
<%Response.Write "started" %>
<td class="evenrow" COLSPAN=6 width="5%"><%=start%></td>
<td class="evenrow" width="10%">
<%dt.MoveFirst%>
<%=dt("revrec_itemcode")%>
<a HREF="QCustomerDetail.asp?<%=ExtraStr%>&ccode=<%=dt("revrec_itemcode")%>">
<td class="evenrow"><%=dt("cust_name")%></a></td>
<td class="evenrow" width="15%"><%=dt("cust_contact_name")%></td>
<td class="evenrow" WIDTH="12%"><%=dt("cust_phone")%></td>
<td class="evenrow" WIDTH="12%"><%=dt("cust_fax")%></td>
<td class="evenrow" align="center" width="5%"><center>
<input type="checkbox" id="chkd" name="chkd" value="<%=common.ConvertSpecialCharacters(sid)%>"></center>
</td>
<td class="evenrow" ><a href="QCustomerCalls.asp">Issue<%=start%></a></td>
<%
start = start + 1
<%dt.Close %>
<tr><td class="evenrow" colspan=7><%'=dt1.RecordCount %>There are no customer record found.</td></tr>
</table>
</td>
</tr>
<tr><td class="evenrow" colspan=2> </td></tr>
<TR><TH CLASS=inforow colspan=2> </th></tr>
</table>
</form>
<br>
<%
end sub
This is the code block of my application. Appropriate include files are given. I have not given it here, only limited text is allowed.
The output should be, this way:
CompCode OtherComp.Details Issues
Company1 ....... Issue1
Issue2
Issue3
Company2 ....... Issue1
Issue2
Issue3
Company3 ....... Issue1
Issue2
Issue3
and so on.
But when I am running this code, I am reading the output as
CompCode OtherComp.Details Issues
Company1 ....... Issue1
Its not displaying anyother details. I feel basically, its a logical error than a syntactical or any other error. Can u refer to this code and then let me know, where I have gone wrong. If I am not upto the mark, then tell me what changes I am supposed to do the above code.
Dim str
Dim strSql
Set common = CreateObject("IQMS.Common")
Set conn = CreateObject("ADODB.Connection")
Set iCon = CreateObject("iKnow.iControl")
'Recordset for generating the other information
Set dt = CreateObject("ADODB.Recordset")
'This recordset is specially for Issues
'Set dt1 = CreateObject ("ADODB.Recordset")
'Recordset For generating the complaint details
'Set dt1= CreateObject ("ADODB.Recordset")
conn.Open ConnectionString
iCon.OpenDB ConnectionString
start = 1
</body>
</html>
<%
sub doList
%>
<%=iPub.Component.Styles.STYLEHTML%>
<title><%=iPub%> - <%=iPub.Component%></title>
</head>
<body <%=iPub.Component.BODY%>>
<%
Response.write iPub.Component.TitleBar(iPub.Component.Captions("Customers List"),0)
Response.Write pagetablestart()
showhelptext "QCustomerList.asp","Customer Listing"
Response.Buffer=TRUE
Response.Flush
SQL = "select review_item.revrec_itemcode, customer.cust_name, customer.cust_contact_name, customer.cust_phone, customer.cust_fax, review_item.revrec_type from customer, review_item where customer.cust_code = review_item.revrec_itemcode order by customer.cust_code"
dt.Open SQL, Conn,1,1
if dt.eof then response.redirect request.servervariables("revrec_itemcode")
dt.MoveFirst
<br>
<table>
<tr>
<td>
<form name=delform id=delform action="QCustomerList.asp">
<%=extrastring%>
<input type="hidden" name="mode" value="delete">
<table border=1 class="inputtable" width="100%" align="center" id=table1>
<!--Just counting the numb<A HREF="file://C:\WINDOWS\Application Data\Microsoft\Internet Explorer\Quick Launch\Launch Internet Explorer Browser.lnk">file://C:\WINDOWS\Application Data\Microsoft\Internet Explorer\Quick Launch\Launch Internet Explorer Browser.lnk</A>er of customer complaints available-->
<TR><TH CLASS=inforow colspan=2> There are <%=dt.recordcount & " "%>
<%=ipub.Component.Captions("customer(s)")%> found.</th></tr>
<tr><td class="evenrow" colspan=2> </td></tr>
<tr><td class="evenrow" colspan=2>
<li>Click <a HREF="QCustomerCreate.asp?<%=ExtraStr%>">here</a> to create new customer.</li>
</td></tr><br>
<tr><td class="evenrow" colspan=2>
<li>Click <a href="" onclick="if (confirm('Are you sure you want to delete the selected records?')) { delform.submit();} return false;">here</a> to delete selected records.</li>
</Td></tr>
<tr><td class="evenrow" colspan=2> </td></tr>
<tr>
<td class="evenrow" style="width:30px"> </td>
<td class="evenrow">
<table class="listtable" width="100%" align="left">
<tr>
<td class="headrow" colspan=2 align="center">No.</td>
<td class="headrow" colspan=4 align="center">Customer Code</td>
<td class="headrow" colspan=4 align="center">Customer Name</td>
<td class="headrow" colspan=4 align="center">Contact Person</td>
<td class="headrow" colspan=2 align="center">Phone</td>
<td class="headrow" colspan=2 align="center">Fax</td>
<td class="headrow" colspan=2 align="center">Delete</td>
<td align="centre" class="headrow" colspan=2>Issues</td>
</tr>
dt.MoveFirst
if not dt.EOF then
str = dt("revrec_itemcode")
%>
<td class="evenrow" COLSPAN=2 width="5%">
<%=start%>
<td class="evenrow" colspan=4 width="10%" align="center"><a HREF="QCustomerDetail.asp?<%=ExtraStr%>&ccode=<%=common.ConvertSpecialCharacters(dt("revrec_itemcode"))%>"><%=dt("revrec_itemcode")%></a></td>
<td class="evenrow" colspan=4 width="10%" align="center"><%=dt("cust_name")%></td>
<td class="evenrow" colspan=4 width="10%" align="center"><%=dt("cust_contact_name")%></td>
<td class="evenrow" colspan=2 width="10%" align="center"><%=dt("cust_phone")%></td>
<td class="evenrow" colspan=2 width="10%" align="center"><%=dt("cust_fax")%></td>
<td class="evenrow" align="center" colspan=2 width="10%" align="center"><center><input type="checkbox" id="chkd" name="chkd" value="<%=common.ConvertSpecialCharacters(sid)%>"></center></td>
<%
set tempDt = conn.Execute ("select revrec_type from review_item, customer where customer.cust_code=review_item.revrec_itemcode group by revrec_type;")
Response.Write "created"
strSql = "select revrec_type from review_item, customer where customer.cust_code=review_item.revrec_itemcode group by revrec_type;"
tempDt.Open strSql, Conn,1,1
tempDt.MoveNext
while not tempDt.EOF
%>
<td class="evenrow" colspan=2 width="5%" align="center"><a href="QCustomerCalls.asp"><%=tempDt("revrec_type")%><%=start%></a><%start = start + 1%>
<%
tempdt.MoveNext
wend
%>
</td>
</tr>
<%
end if
%>
</tr>
<!--<table>
<tr>
<td>-->
<!--<a HREF="QCustomerDetail.asp?
<%Response.Write "ExtraStr:" & ExtraStr%>&rcode=<%'=common.ConvertSQLSpecialCharacters(dt1("revrec_itemcode"))%>">
</td></tr>
</table>-->
<%'loop%>
<!--<form name=delform id=delform action="QCustomerList.asp">
<%=extrastring%>
<input type="hidden" name="mode" value="delete">
<table border=1 class="inputtable" width="95%" align="center" id=table1>
<!--Just counting the number of customer complaints available-->
<!--<TR><TH CLASS=inforow colspan=2> There are <%=dt.recordcount & " "%> <%=ipub.Component.Captions("customer(s)")%> found.</th></tr>
<tr><td class="evenrow" colspan=2> </td></tr>
<tr><td class="evenrow" colspan=2>
<li>Click <a HREF="QCustomerCreate.asp?<%=ExtraStr%>">here</a> to create new customer.</li>
</td></tr><br>
<tr><td class="evenrow" colspan=2>
<li>Click <a href="" onclick="if (confirm('Are you sure you want to delete the selected records?')) { delform.submit();} return false;">here</a> to delete selected records.</li>
</Td></tr>
<tr><td class="evenrow" colspan=2> </td></tr>
<tr>
<td class="evenrow" style="width:30px"> </td>
<td class="evenrow">
<table class="listtable" width="95%" align="left">
<tr>
<td class="headrow" COLSPAN=6>No.</td>
<td class="headrow">Customer Code</td>
<td class="headrow">Customer Name</td>
<td class="headrow">Contact Person</td>
<td class="headrow">Phone</td>
<td class="headrow">Fax</td>
<td class="headrow">Delete</td>
<td align=center class="headrow">Issues</td>
</tr>
<tr>
<%Response.Write "started" %>
<td class="evenrow" COLSPAN=6 width="5%"><%=start%></td>
<td class="evenrow" width="10%">
<%dt.MoveFirst%>
<%=dt("revrec_itemcode")%>
<a HREF="QCustomerDetail.asp?<%=ExtraStr%>&ccode=<%=dt("revrec_itemcode")%>">
<td class="evenrow"><%=dt("cust_name")%></a></td>
<td class="evenrow" width="15%"><%=dt("cust_contact_name")%></td>
<td class="evenrow" WIDTH="12%"><%=dt("cust_phone")%></td>
<td class="evenrow" WIDTH="12%"><%=dt("cust_fax")%></td>
<td class="evenrow" align="center" width="5%"><center>
<input type="checkbox" id="chkd" name="chkd" value="<%=common.ConvertSpecialCharacters(sid)%>"></center>
</td>
<td class="evenrow" ><a href="QCustomerCalls.asp">Issue<%=start%></a></td>
<%
start = start + 1
<%dt.Close %>
<tr><td class="evenrow" colspan=7><%'=dt1.RecordCount %>There are no customer record found.</td></tr>
</table>
</td>
</tr>
<tr><td class="evenrow" colspan=2> </td></tr>
<TR><TH CLASS=inforow colspan=2> </th></tr>
</table>
</form>
<br>
<%
end sub
This is the code block of my application. Appropriate include files are given. I have not given it here, only limited text is allowed.
The output should be, this way:
CompCode OtherComp.Details Issues
Company1 ....... Issue1
Issue2
Issue3
Company2 ....... Issue1
Issue2
Issue3
Company3 ....... Issue1
Issue2
Issue3
and so on.
But when I am running this code, I am reading the output as
CompCode OtherComp.Details Issues
Company1 ....... Issue1
Its not displaying anyother details. I feel basically, its a logical error than a syntactical or any other error. Can u refer to this code and then let me know, where I have gone wrong. If I am not upto the mark, then tell me what changes I am supposed to do the above code.