Contents of glajax.asp:
<% set xmldom=server.createobject("Microsoft.XMLDOM") xmldom.load(Request) if xmldom.parseError <> 0 then Response.write xmldom.parseError.reason end if m1=xmldom.documentElement.childnodes(0).text m2=xmldom.documentElement.childnodes(1).text m3=xmldom.documentElement.childnodes(2).text m4=xmldom.documentElement.childnodes(3).text desc=xmldom.documentElement.childnodes(4).text set rs=Server.CreateObject("ADODB.Recordset") SQLString="SELECT * FROM glmaster WHERE " fsw=0 if len(m1) > 0 then SQLString=SQLString+" major LIKE '"+cstr(m1) +"%'" fsw=1 end if if len(m2) > 0 and fsw=0 then SQLString=SQLString+ " minor LIKE '"+cstr(m2) +"%'" fsw=1 else if len(m2) > 0 then SQLString=SQLString+ " AND minor LIKE '"+cstr(m2) +"%'" end if end if if len(m3) > 0 and fsw=0 then SQLString=SQLString+ " sub1 LIKE '"+cstr(m3) +"%'" fsw=1 else if len(m3) > 0 then SQLString=SQLString+ " AND sub1 LIKE '"+cstr(m3) +"%'" end if end if if len(m4) > 0 and fsw=0 then SQLString=SQLString+ " sub2 LIKE '"+cstr(m4) +"%'" fsw=1 else if len(m4) > 0 then SQLString=SQLString+ " AND sub2 LIKE '"+cstr(m4) +"%'" end if end if if len(desc) > 0 and fsw=0 then SQLString=SQLString+ " acctdesc LIKE '"+cstr(desc) +"%'" fsw=1 else if len(desc) > 0 then SQLString=SQLString+ " AND acctdesc LIKE '"+cstr(desc) +"%'" end if end if if len(m1) =0 and len(m2)=0 and len(m3)=0 and len(m4)=0 and len(desc)=0 then SQLString="Select * from glmaster" fsw=1 end if response.write "<p><table border='1'><tr><td colspan='6' bgcolor='#aaaaaa' align='center'><b>Results</td></tr><tr>" response.write "<td align='center'>Major</td>" response.write "<td align='center'>Minor</td>" response.write "<td align='center'>Sub1</td>" response.write "<td align='center'>Sub2</td>" response.write "<td align='center'>Account Description</td>" response.write "<td align='center'>Account<br>Balance</td></tr>" 'response.write "<p>SQL STRING="+cstr(SQLString) if fsw=1 then c=0 rs.open SQLString,"DSN=gl001;UID=gl001;PWD=11111;" while not rs.eof response.write "<tr><td align='center'>" response.write cstr(rs("major"))+"</td><td align='right'>" response.write cstr(rs("minor"))+"</td><td align='right'>" response.write cstr(rs("sub1"))+"</td><td align='right'>" response.write cstr(rs("sub2"))+"</td><td align='right'>" response.write cstr(rs("acctdesc"))+"</td><td align='right'>" response.write formatnumber(rs("balance"),2)+"</td></tr>" c=c+1 rs.movenext wend rs.close set rs=nothing end if response.write "</table><p><b>"+cstr(c)+" matching records found" 'response.write "<p>SQL STRING="+cstr(SQLString) %>
***** end of file *** printed: 106 lines on: 11/23/2009 6:00:28 AM