p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Dreamweaver (all versions) (http://p2p.wrox.com/forumdisplay.php?f=58)
-   -   MS Access SQL Problem (http://p2p.wrox.com/showthread.php?t=78046)

leonardpogrady February 1st, 2010 08:18 PM

MS Access SQL Problem
 
Hi,

I am developing a site with ASPVisualBasic, Dreamweaver MX and MS Access Database. I have a login page that opens from a relational database users.mdb with 2 tables Client/Company. I enter user and password and that takes me to another page my products and services page. This has links to a number of my services. The one I am having a problem with is upload debtors.

Having already login in when I click upload debtors a new form opens and the details of the client who loged in should populate the form from the 2 tables Client/Company.

I have 2 Recordsets (Recordset1) for the Company table and (rsclient) for the Client table.

The populating data from the (rsclient) inserts into the form ok changing to suite the different client login's and displaying their matching data correctly.

(The Problem) is the populating data from the (Recordset1) that should display things like Company Name, Trading name and so on, will not change the details based on the user who logs in. No matter what login/(matches the ID row) I use it will only display the first row in the table Company, when I deleted the first row of data it displayed the 2nd row of data not matching the row connecting the login details.

(Recordset1) SQL looks like this-

SELECT *
FROM Company
WHERE CompanyID like 'qrycompanyid'

Variables look like this -
NAME DEFAULT VALUE RUN-TIME VALUE
qrycompanyid % Request.QueryString("ClientCompanyID")

(rsclient) SQL looks like this- and remember this works

SELECT *
FROM clients
WHERE UsrName like 'MM_Username'

Variables look like this-
NAME DEFAULT VALUE RUN-TIME VALUE
MM_Username % Session("MM_Username")

Can anybody out there get me out of trouble with above?

Cheers

Leonard P.O'Grady
Whitsundays
Australia

Imar February 2nd, 2010 06:58 AM

Can you post the relevant bits of your ASP code? E.g. the part that defines the SQL statement and fills in the parameters? Also, are you sure the QueryString contains the correct value for each company?

Imar

leonardpogrady February 2nd, 2010 08:04 AM

MS Access SQL Problem
 
Hi Imar,

You are the hardest working man in this forum!

Recordset1 Inserts in my form shown below-

Code:


Company Name or Name of Partners: {Recordset1.CompName}
ABN / ACN: {Recordset1.CompABN_ACN}
Trading Name/s: {Recordset1.CompTradAs}
Trading Address: {Recordset1.CompTrdAdL1}
                      {Recordset1.CompTrdAdL2}
                      {Recordset1.CompTrdAdL3}
                      {Recordset1.CompTrdCrty}

Server behaviors below in same order-
<%= Recordset1.Fields.Item("CompName").Value %>
<%= Recordset1.Fields.Item("CompABN_ACN").Value %>
<%= Recordset1.Fields.Item("CompTradAs").Value %>
<%=(Recordset1.Fields.Item("CompTrdAdL1").Value)%>
<%=(Recordset1.Fields.Item("CompTrdAdL2").Value)%>
<%=(Recordset1.Fields.Item("CompTrdAdL3").Value)%>
<%=(Recordset1.Fields.Item("CompTrdCrty").Value)%>

Your Statement -

Also, are you sure the QueryString contains the correct value for each company?

No I am not sure at all, my experince writing querystrings is zip! This work was done by a former empoyee of mine years ago, I did work once but the data has been passed around to a few different devises over the years.

Above looks ok (unless you see somthing out of place I am not seeing) but
the Recordset1 SQL set up in the Server Behaviors I sent in the last post is probably not right. I say that because the above {Recordset1.CompName} and all the rest below it show the right value in each Recordset but is stuck on the first row of the table Company? no matter what login user/password is used and I have a different ID for each?

Cheers

Len

Imar February 2nd, 2010 08:13 AM

Actually, I meant the code that builds up the SQL statement. You posted the SQL statement earlier, but as you posted it, it won't get you a dynamic company at all:

SELECT *
FROM Company
WHERE CompanyID like 'qrycompanyid'

This always finds companies where the CompanyID contains the literal qrycompanyid. So, somewhere it must be made dynamic.

Quote:

No I am not sure at all, my experince writing querystrings is zip!
Take a look at the query string in the browser's address bar on the page where you're editing. Do you see a variable called ClientCompanyID, and does it change with each company you're editing?

Imar

leonardpogrady February 2nd, 2010 09:07 AM

MS Access SQL Problem
 
Hi,

The below Server behaviors in DW are named Dynamic Text field

Code:


Server behaviors below in same order-
<%= Recordset1.Fields.Item("CompName").Value %>
<%= Recordset1.Fields.Item("CompABN_ACN").Value %>
<%= Recordset1.Fields.Item("CompTradAs").Value %>
<%=(Recordset1.Fields.Item("CompTrdAdL1").Value)%>
<%=(Recordset1.Fields.Item("CompTrdAdL2").Value)%>
<%=(Recordset1.Fields.Item("CompTrdAdL3").Value)%>
<%=(Recordset1.Fields.Item("CompTrdCrty").Value)%>

Is that what you ar looking for?

I noticed somthing, when I double click the Dynamic Text field Client Company Name in the Server Behaviors panel another dialog box opens with-

Set value to <%= Recordset1.Fields.Item("CompName").Value %>
at the bottem of the box from a list of Columns from the Company file, the id
Columns is also there but not selected. I do not see where the Id is selected anywere in the Dynamic Text field such as the ("CompName").Value

LEN

Imar February 2nd, 2010 09:11 AM

No, I meant the code that builds up this SQL statement:

SELECT *
FROM Company
WHERE CompanyID like 'qrycompanyid'

Imar

leonardpogrady February 2nd, 2010 09:50 AM

MS Access SQL Problem
 
Hi,

I am not sure how to extract that out of dreamweaver. As I said it is in the server behaviors. How do I get at the code?

Len

Imar February 2nd, 2010 10:35 AM

You should have Code / Design / Split buttons on the Document toolbar above your document that enables you to switch from Design View to Code View.

Do you have a book on using Dreamweaver? Looks like you may need one to get up to speed a little with Dreamweaver. We can help you out with problems here, but this certainly isn't the best way to learn Dreamweaver or ASP.... ;-)

Cheers,

Imar

leonardpogrady February 2nd, 2010 06:33 PM

MS Access SQL Problem
 
Hi,

Sorry I thought you were talking about the code behind the dialog box in the server behaviors. I know how to turn the document page in dreamveaver from design to code.

Code:


<%@LANGUAGE="VBSCRIPT"%>
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="0,1"
MM_authFailedURL="../content/online.htm"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
  If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
        (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=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
%>
<!--#include file="../Connections/collectoz.asp" -->
<%
Dim Recordset1__qrycompanyid
Recordset1__qrycompanyid = "%"
If (Request.QueryString("ClientCompanyID") <> "") Then
  Recordset1__qrycompanyid = Request.QueryString("ClientCompanyID")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_collectoz_STRING
Recordset1.Source = "select *  from Company  where CompanyID like '" + Replace(Recordset1__qrycompanyid, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
Dim rsclient__MM_Username
rsclient__MM_Username = "%"
If (Session("MM_Username") <> "") Then
  rsclient__MM_Username = Session("MM_Username")
End If
%>
<%
Dim rsclient
Dim rsclient_numRows

Set rsclient = Server.CreateObject("ADODB.Recordset")
rsclient.ActiveConnection = MM_collectoz_STRING
rsclient.Source = "Select *  from clients  where UsrName like '" + Replace(rsclient__MM_Username, "'", "''") + "'"
rsclient.CursorType = 0
rsclient.CursorLocation = 2
rsclient.LockType = 1
rsclient.Open()

rsclient_numRows = 0
%>
<html><!-- #BeginTemplate "/Templates/Subpage.dwt" -->
<head>
<!-- #BeginEditable "doctitle" -->
<title>Collect Australia Pty. Ltd. Online Services</title>
<!-- #EndEditable -->
<meta http-equiv="Content-Type" content="text/html;">
<script language="JavaScript">
<!--
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script></head>
<body bgcolor="336699" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" text="#FFFFFF" link="#FFFFFF" vlink="#CCCCCC" alink="#FFFFFF">
<table bgcolor="#336699" border="0" cellpadding="0" cellspacing="0" width="689" height="8" align="center">
  <tr>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="146" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="141" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="16" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="135" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="17" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="101" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="17" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="77" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="64" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr>
    <td colspan="9"><img name="slice01" src="http://www.collectoz.com/images/slice41.gif" width="714" height="106" border="0" usemap="#Home"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="1" height="106" border="0"></td>
  </tr>
  <tr>
    <td colspan="5"><img name="slice02" src="http://www.collectoz.com/images/slice42.gif" width="455" height="1" border="0"></td>
    <td rowspan="5"><a href="../content/online.asp"><img name="slice03" src="http://www.collectoz.com/images/slice43.gif" width="101" height="16" border="0"></a></td>
    <td rowspan="2" colspan="3"><img name="slice04" src="http://www.collectoz.com/images/slice44.gif" width="158" height="2" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr>
    <td rowspan="3"><img name="slice05" src="http://www.collectoz.com/images/slice45.gif" width="146" height="13" border="0"></td>
    <td rowspan="4"><a href="../content/aboutus.htm"><img name="slice06" src="http://www.collectoz.com/images/slice46.gif" width="141" height="15" border="0"></a></td>
    <td rowspan="3"><img name="slice07" src="http://www.collectoz.com/images/slice47.gif" width="16" height="13" border="0"></td>
    <td rowspan="4"><a href="../content/products.htm"><img name="slice08" src="http://www.collectoz.com/images/slice48.gif" width="135" height="15" border="0"></a></td>
    <td rowspan="3"><img name="slice09" src="http://www.collectoz.com/images/slice49.gif" width="17" height="13" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr>
    <td rowspan="2"><img name="slice10" src="http://www.collectoz.com/images/slice50.gif" width="17" height="12" border="0"></td>
    <td height="9"><a href="../content/contactus.htm"><img name="slice11" src="http://www.collectoz.com/images/slice51.gif" width="77" height="11" border="0"></a></td>
    <td rowspan="2"><img name="slice12" src="http://www.collectoz.com/images/slice52.gif" width="64" height="12" border="0"></td>
    <td height="9"><img src="http://www.collectoz.com/images/spacer.gif" width="1" height="11" border="0"></td>
  </tr>
  <tr>
    <td><img name="slice13" src="http://www.collectoz.com/images/slice53.gif" width="77" height="1" border="0"></td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="1" height="1" border="0"></td>
  </tr>
  <tr>
    <td rowspan="2" bgcolor="#336699">&nbsp;</td>
    <td rowspan="2" bgcolor="#336699">&nbsp;</td>
    <td rowspan="2" bgcolor="#336699">&nbsp;</td>
    <td rowspan="2" colspan="3" bgcolor="#336699">&nbsp;</td>
    <td><img src="http://www.collectoz.com/images/spacer.gif" width="1" height="2" border="0"></td>
  </tr>
  <td height="13">&nbsp;
</table>
<table width="715" border="0" cellspacing="0" cellpadding="0" height="143" align="center">
  <tr>
    <td height="121" valign="top"><!-- #BeginEditable "Content" -->
      <p><FONT size="+1"><B><FONT face="Arial, Helvetica, sans-serif">Upload Debtors
        <BR>
        </FONT></B><FONT size="-1" face="Arial, Helvetica, sans-serif"><A href="logout.asp">Click
        here to log out</A></FONT></FONT></p>
      <p><font face="Arial, Helvetica, sans-serif" size="-1">To begin the process
        of collecting your debt, we need to find out the neccessary information
        about your debtor. Please gather the required information and enter it
        into the fields below. When completed simply left-click on the &quot;Upload
        Debtor to Collect Australia Pty. Ltd.&quot; button located at the bottom
        of the page. Lets get started.</font></p>
      <form name="Upload Debtors" method="post" action="http://mailgate.server-mail.com/cgi-bin/mailgate">
        <table width="600" border="0" cellspacing="0" cellpadding="3" align="center" height="337">
          <tr>
            <td colspan="2"><b><font face="Arial, Helvetica, sans-serif" size="-1">
              Your Contact Information</font></b></td>
          </tr>
          <tr>
            <td width="269"><font face="Arial, Helvetica, sans-serif" size="-1">Company
              Name or Name of Partners:</font></td>
            <td width="331"> <font face="Arial, Helvetica, sans-serif" size="-1">
              <input name="Client Company Name/Partners" type="text" value="<%=(Recordset1.Fields.Item("CompName").Value)%>" size="40" maxlength="1000">
              </font></td>
          </tr>
          <tr>
            <td width="269"><font face="Arial, Helvetica, sans-serif" size="-1">ABN
              / ACN:</font></td>
            <td width="331"> <font face="Arial, Helvetica, sans-serif" size="-1">
              <input name="Cleint ABN/ACN" type="text" value="<%=(Recordset1.Fields.Item("CompABN_ACN").Value)%>" size="40" maxlength="1000">
              </font></td>
          </tr>
          <tr>
            <td width="269"><font face="Arial, Helvetica, sans-serif" size="-1">Trading
              Name/s:</font></td>
            <td width="331"> <font face="Arial, Helvetica, sans-serif" size="-1">
              <input name="Client Trading As" type="text" value="<%=(Recordset1.Fields.Item("CompTradAs").Value)%>" size="40" maxlength="1000">
              </font></td>
          </tr>
          <tr>
            <td width="269" valign="top"><font face="Arial, Helvetica, sans-serif" size="-1">Trading
              Address:<br>
              <font size="-4">Please enter full address including State, Post
              code, and Country.</font> </font></td>
            <td width="331"><font face="Arial, Helvetica, sans-serif" size="-1">&nbsp;
              </font>
              <table width="75%" border="0">
                <tr>
                  <td><%=(Recordset1.Fields.Item("CompTrdAdL1").Value)%></td>
                </tr>
                <tr>
                  <td><%=(Recordset1.Fields.Item("CompTrdAdL2").Value)%></td>
                </tr>
                <tr>
                  <td><%=(Recordset1.Fields.Item("CompTrdAdL3").Value)%></td>
                </tr>
                <tr>
                  <td><%=(Recordset1.Fields.Item("CompTrdCrty").Value)%></td>
                </tr>
              </table>
              <font face="Arial, Helvetica, sans-serif" size="-1">&nbsp; </font></td>
          </tr>
          <tr>
            <td colspan="2" valign="top">
              <table width="600" border="0" cellspacing="0" cellpadding="3" align="center">
                <tr>
                  <td width="269"><font face="Arial, Helvetica, sans-serif" size="-1">Contact
                    Name/s:</font></td>
                  <td width="331"> <font face="Arial, Helvetica, sans-serif" size="-1">
                    <input name="Client Contact Name" type="text" value="<%=(rsclient.Fields.Item("UsrName").Value)%>" size="40" maxlength="1000">
                    </font></td>
                </tr>
                <tr>
                  <td width="269" height="26"><font face="Arial, Helvetica, sans-serif" size="-1">E-mail
                    Address:</font></td>
                  <td width="331" height="26">
                    <input name="Client Email" type="text" value="<%=(rsclient.Fields.Item("Email").Value)%>" size="40" maxlength="1000">
                  </td>
                </tr>
                <tr>
                  <td width="269" height="26"><font face="Arial, Helvetica, sans-serif" size="-1">Telephone
                    #:</font></td>
                  <td width="331" height="26"> <font face="Arial, Helvetica, sans-serif" size="-1">
                    <input name="Client Telephone#" type="text" value="<%=(rsclient.Fields.Item("Phone").Value)%>" size="30" maxlength="30">
                    </font></td>
                </tr>
                <tr>
                  <td width="269"><font face="Arial, Helvetica, sans-serif" size="-1">Faxmail
                    #:</font></td>
                  <td width="331"> <font face="Arial, Helvetica, sans-serif" size="-1">
                    <input name="Client Fax#" type="text" value="<%=(rsclient.Fields.Item("Fax").Value)%>" size="30" maxlength="1000">
                    </font></td>
                </tr>
              </table>
              <font face="Arial, Helvetica, sans-serif" size="-1">&nbsp; </font></td>
          </tr>
        </table>
        <input type=hidden name="recipient" value="debtors@collectoz.com">
        <input type=hidden name="subject" value="Debtor Uploaded">
        <input type=hidden name="redirect" value="http://www.collectoz.com/ssl/confirm.asp">
        <input type=hidden name="realname" value="Online Services">
        <table width="601" border="0" cellspacing="0" cellpadding="3" align="center">
          <tr>
            <td colspan="2"><b><font face="Arial, Helvetica, sans-serif" size="-1">Your
              Debtor</font></b></td>
          </tr>
          <tr>
            <td width="263"><font face="Arial, Helvetica, sans-serif" size="-1">Company
              Name:</font></td>
            <td width="326"> <font face="Arial, Helvetica, sans-serif" size="-1">
              <input type="text" name="Company Name" size="40" maxlength="1000">
              </font></td>
          </tr>
          <tr>
            <td width="263"><font face="Arial, Helvetica, sans-serif" size="-1">ABN
              / ACN: </font></td>
            <td width="326"> <font face="Arial, Helvetica, sans-serif" size="-1">
              <input type="text" name="ACN/ABN" size="40" maxlength="1000">
              </font></td>
          </tr>
          <tr>
            <td width="263"><font face="Arial, Helvetica, sans-serif" size="-1">Trading
              Name/s:</font></td>
            <td width="326"> <font face="Arial, Helvetica, sans-serif" size="-1">
              <input type="text" name="Trading as" size="40" maxlength="1000">
              </font></td>
          </tr>
          <tr>
            <td width="263" height="63" valign="top"><font face="Arial, Helvetica, sans-serif" size="-1">Company
              Director/s:</font><font face="Arial, Helvetica, sans-serif"><br>
              <font size="-3">If there are multiple directors, please list them
              by placing a<br>
              semi-colon after each director.</font></font><br>
            </td>
            <td width="326" height="63" valign="top">
              <input type="text" name="Company Directors" value="" size="50">
            </td>
          </tr>
          <tr>
            <td width="263" valign="top">
              <p><font face="Arial, Helvetica, sans-serif" size="-1">Trading Address:<br>
                <font size="-3">Please enter full address including State, Post
                code, and<br>
                </font></font><font face="Arial, Helvetica, sans-serif" size="-3">Country.<br>
                </font></p>
            </td>
            <td width="326"> <font face="Arial, Helvetica, sans-serif" size="-1">
              <textarea name="Trading Address" wrap="VIRTUAL" cols="30" rows="3"></textarea>
              </font></td>
          </tr>
          <tr>
            <td width="263" valign="top"><font face="Arial, Helvetica, sans-serif" size="-1">Postal
              Address:<br>
              <font size="-3">Please enter full address including State, Post
              code, and Country. </font> </font></td>
            <td width="326"> <font face="Arial, Helvetica, sans-serif" size="-1">
              <textarea name="Postal Address" wrap="VIRTUAL" cols="30" rows="3"></textarea>
              </font></td>
          </tr>
        </table>
        <br>
        <table width="601" border="0" cellspacing="0" cellpadding="3" align="center">
          <tr>
            <td colspan="2"><b><font face="Arial, Helvetica, sans-serif" size="-1">Debtor
              Contact Information</font></b></td>
          </tr>
          <tr>
            <td width="263"><font face="Arial, Helvetica, sans-serif" size="-1">Contact
              Name/s:</font></td>
            <td width="326"> <font face="Arial, Helvetica, sans-serif" size="-1">
              <input type="text" name="Contact Name" size="40" maxlength="1000">
              </font></td>
          </tr>
          <tr>
            <td width="263" height="26"><font face="Arial, Helvetica, sans-serif" size="-1">E-mail
              Address:</font></td>
            <td width="326" height="26">
              <input type="text" name="Email" size="40" maxlength="1000">
            </td>
          </tr>
          <tr>
            <td width="263" height="26"><font face="Arial, Helvetica, sans-serif" size="-1">Telephone
              #:</font></td>
            <td width="326" height="26"> <font face="Arial, Helvetica, sans-serif" size="-1">
              <input type="text" name="Telephone#" size="30" maxlength="30">
              </font></td>
          </tr>
          <tr>
            <td width="263"><font face="Arial, Helvetica, sans-serif" size="-1">Faxmail
              #:</font></td>
            <td width="326"> <font face="Arial, Helvetica, sans-serif" size="-1">
              <input type="text" name="Fax#" size="30" maxlength="1000">
              </font></td>
          </tr>
          <tr>
            <td width="263"><font face="Arial, Helvetica, sans-serif" size="-1">Mobile
              Telephone #:</font></td>
            <td width="326"> <font face="Arial, Helvetica, sans-serif" size="-1">
              <input type="text" name="Mobile#" size="30" maxlength="1000">
              </font></td>
          </tr>
        </table>
        <br>
        <table width="602" border="0" cellpadding="0" cellspacing="0" height="240" align="center">
          <tr>
            <td colspan="2" height="34"><font face="Arial, Helvetica, sans-serif" size="-1"><b>Information
              of incurred debt</b></font></td>
          </tr>
          <tr valign="top">
            <td width="269" height="54"><font face="Arial, Helvetica, sans-serif" size="-1">The
              Invoice Number:</font><br>
              <font face="Arial, Helvetica, sans-serif" size="-3">If you have
              a number of invoices include only the first and<br>
              last issued.</font></td>
            <td height="54" width="330"> <font face="Arial, Helvetica, sans-serif" size="-1">First
              Invoice#
              <input type="text" name="Invoice#1" size="10">
              Last Invoice#
              <input type="text" name="Invoice#2" size="10">
              </font> </td>
          </tr>
          <tr valign="top">
            <td height="41" width="269"><font face="Arial, Helvetica, sans-serif" size="-1">Date
              of Debt:</font><br>
              <font face="Arial, Helvetica, sans-serif" size="-3">The date which
              the first invoice was issued. (DD/MM/YYYY)</font></td>
            <td height="41" width="330">
              <input type="text" name="Date of 1st Invoice" size="30">
            </td>
          </tr>
          <tr valign="top">
            <td height="40" width="269"><font face="Arial, Helvetica, sans-serif" size="-1">Date
              of Last Invoice:</font><font face="Arial, Helvetica, sans-serif"><br>
              <font size="-3">The date when the last invoice was issued. </font><font face="Arial, Helvetica, sans-serif" size="-3">(DD/MM/YYYY)</font></font></td>
            <td height="40" width="330">
              <input type="text" name="Date of last invoice" size="30">
            </td>
          </tr>
          <tr>
            <td height="48" width="269"><font size="-1" face="Arial, Helvetica, sans-serif">The
              amount of debt:</font></td>
            <td height="48" width="330">
              <input type="text" name="Amount ($)" size="30" value="$0.00">
            </td>
          </tr>
          <tr valign="top">
            <td height="26" width="269"><font face="Arial, Helvetica, sans-serif" size="-1">The
              debt was the result from:</font></td>
            <td height="26" width="330"> <font face="Arial, Helvetica, sans-serif" size="-1">
              <select name="Debt incurred by">
                <option>Please Select</option>
                <option value="goods sold">Goods sold</option>
                <option value="services rended">Services rended</option>
                <option value="dishonoured check">Dishonoured check</option>
                <option value="services rended and goods sold">Services rended
                and goods sold</option>
              </select>
              </font></td>
          </tr>
        </table>
        <br>
        <table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
          <tr>
            <td colspan="2" height="29"><b><font face="Arial, Helvetica, sans-serif" size="-1">Important
              Information</font></b></td>
          </tr>
          <tr>
            <td height="26"><font face="Arial, Helvetica, sans-serif" size="-1">Do
              you have a signed Credit Application:</font></td>
            <td> <font face="Arial, Helvetica, sans-serif" size="-1">
              <select name="Credit App. Signed">
                <option selected>Please Select</option>
                <option value="Yes">Yes</option>
                <option value="No">No</option>
              </select>
              </font></td>
          </tr>
          <tr>
            <td height="26"><font face="Arial, Helvetica, sans-serif" size="-1">Do
              you have a Directors Guarantee:</font></td>
            <td> <font face="Arial, Helvetica, sans-serif" size="-1">
              <select name="Directors Guarantee">
                <option selected>Please Select</option>
                <option value="Yes">Yes</option>
                <option value="No">No</option>
              </select>
              </font></td>
          </tr>
        </table>
        <br>
        <table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
          <tr>
            <td colspan="2" height="26"><b><font face="Arial, Helvetica, sans-serif" size="-1">What
              to do next?</font></b></td>
          </tr>
          <tr>
            <td width="375" height="26"><font face="Arial, Helvetica, sans-serif" size="-1">Would
              you like us to make a debtor assessment call:</font></td>
            <td width="225" height="26"><font face="Arial, Helvetica, sans-serif" size="-1">
              <select name="Make Debt Assess Call">
                <option selected>Please Select</option>
                <option value="Yes">Yes</option>
                <option value="No">No</option>
              </select>
              </font></td>
          </tr>
          <tr>
            <td width="375" height="38"><font face="Arial, Helvetica, sans-serif" size="-1">Would
              you like us to issue a letter of demand from Gill &amp; Lane Solicitors:</font></td>
            <td width="225" height="38"><font face="Arial, Helvetica, sans-serif" size="-1">
              <select name="Issue Letter of Demand">
                <option selected>Please Select</option>
                <option value="Yes">Yes</option>
                <option value="No">No</option>
              </select>
              </font></td>
          </tr>
          <tr>
            <td width="375" height="26"><font face="Arial, Helvetica, sans-serif" size="-1">Take
              immediate legal action to recover debt:</font></td>
            <td width="225" height="26"><font face="Arial, Helvetica, sans-serif" size="-1">
              <select name="Take Immediate Action">
                <option selected>Please Select</option>
                <option value="Not at this stage">Not at this stage</option>
                <option value="Yes - Magistrates Court">Yes - Magistrates Court</option>
                <option value="Yes - Minor Debt Court">Yes - Minor Debt Court</option>
              </select>
              </font></td>
          </tr>
        </table>
        <br>
        <table width="600" border="0" cellspacing="0" cellpadding="3" align="center">
          <tr>
            <td align="center">
              <input type="reset" name="clear" value="      Cancel      " onClick="MM_goToURL('parent','https://bne070u.server-securmainmenu.asp');return document.MM_returnValue">
              <input type="submit" name="Send" value="        Upload Debtor to Collect Australia Pty. Ltd.        ">
            </td>
          </tr>
        </table>
        <br>
        <br>
        <br>
      </form>
      <p>&nbsp;</p>
      <!-- #EndEditable --></td>
  </tr>
</table>
<table width="714" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr>
    <td><font face="Arial, Helvetica, sans-serif" size="-1">| <a href="../main.asp">Home</a>
      | <a href="../content/aboutus.htm">About Us</a> | <a href="../content/products.htm">Products
      &amp; Services</a> | <a href="../content/online.asp">Online Services</a>
      | <a href="../content/contactus.htm">Contact Us</a> | <a href="../content/jobs.htm">Jobs</a>
      |<br>
      Site Designed by <a href="../collectozit/aboutsite.htm">Collect Australia IT Team</a><br>
      <font size="-2">&copy; Content Copyright 2002 Collect Australia Pty. Ltd.
      ABN 98 098 190 026. </font></font></td>
  </tr>
</table>
<map name="Home">
  <area shape="rect" coords="0,-1,391,96" href="../main.asp" alt="Home" title="Home">
</map>
</body>
<!-- #EndTemplate --></html>

<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
rsclient.Close()
Set rsclient = Nothing
%>

Cheers

Len

Old Pedant February 2nd, 2010 09:39 PM

I know I'm being a curmudgeon about this, but this is such a wonderful example of what a pile of [censcored] that DW is that I have to pick on it.
Code:

  If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
        (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    MM_grantAccess = true

Because of the "true" there, the IF test will *ALWAYS* go to the THEN part. So if you hit this line, MM_grantAccess *will* be true.

Now, if DW was smart enough to KNOW that this site/page isn't using MM_UserAuthorization, then WHY COULDN'T it be smart enough to collapse this IF test out of existence???

And so then we can start collapsing more code:
Code:

<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="0,1"
MM_authFailedURL="../content/online.htm"
MM_grantAccess=false
If Session("MM_Username") <> "" Then MM_grantAccess = true
If Not MM_grantAccess Then
...

And then collapse again:
Code:

<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="0,1"
MM_authFailedURL="../content/online.htm"
MM_grantAccess= (Session("MM_Username") <> "" )

And again... well, you get the idea. Even a *tiny* bit of code analysis would have permitted the DW people to collapse that all down to this:
Code:

<%
' *** Restrict Access To Page: Grant or deny access to this page
If Session("MM_Username") = "" Then
  MM_referrer = Request.ServerVariables("URL") & "?" & Request.QueryString()
  Response.Redirect "../content/online.htm?accessdenied=" & Server.URLEncode(MM_referrer)
End If
%>

Which I would have considered reasonable.


All times are GMT -4. The time now is 12:40 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.