[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

07/02/2009 at 10:24AM PDT, ID: 24540325
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

Coldfusion Query Database from form output to screen

Asked by slo1215 in Cold Fusion Markup Language

I want a user to enter an invoice number and get their name. I am getting all of the data for all invoices and users. I am not sure where I have messed this up at.
I am using coldfusion 5 and access.

Thank You!!!!!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="JavaScript" type="text/JavaScript">
<!--
    function MM_findObj(n, d) { //v4.01
        var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
        if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
            for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
        if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
 
    function YY_checkform() { //v4.71
        //copyright (c)1998,2002 Yaromat.com
        var a=YY_checkform.arguments,oo=true,v='',s='',err=false,r,o,at,o1,t,i,j,ma,rx,cd,cm,cy,dte,at;
        for (i=1; i<a.length;i=i+4){
        if (a[i+1].charAt(0)=='#'){r=true; a[i+1]=a[i+1].substring(1);}else{r=false}
            o=MM_findObj(a[i].replace(/\[\d+\]/ig,""));
            o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,""));
            v=o.value;t=a[i+2];
        if (o.type=='text'||o.type=='password'||o.type=='hidden'){
        if (r&&v.length==0){err=true}
        if (v.length>0)
        if (t==1){ //fromto
            ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true}
        } else if (t==2){
            rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true;
        } else if (t==3){ // date
            ma=a[i+1].split("#");at=v.match(ma[0]);
            if(at){
                cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]];
                dte=new Date(cy,cm,cd);
            if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true};
            }else{err=true}
            } else if (t==4){ // time
                ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true}
            } else if (t==5){ // check this 2
        if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")];
        if(!o1.checked){err=true}
        } else if (t==6){ // the same
        if(v!=MM_findObj(a[i+1]).value){err=true}
        }
        } else
        if (!o.type&&o.length>0&&o[0].type=='radio'){
        at = a[i].match(/(.*)\[(\d+)\].*/i);
            o2=(o.length>1)?o[at[2]]:o;
            if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true}
            if (t==2){
        oo=false;
        for(j=0;j<o.length;j++){oo=oo||o[j].checked}
        if(!oo){s+='* '+a[i+3]+'\n'}
            }
        } else if (o.type=='checkbox'){
            if((t==1&&o.checked==false)||(t==2&&o.checked&&o1&&o1.value.length/1==0)){err=true}
        } else if (o.type=='select-one'||o.type=='select-multiple'){
            if(t==1&&o.selectedIndex/1==0){err=true}
        }else if (o.type=='textarea'){
        if(v.length<a[i+1]){err=true}
            }
        if (err){s+='* '+a[i+3]+'\n'; err=false}
        }
        if (s!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+s)}
        document.MM_returnValue = (s=='');
    }
//-->
</script>
 
 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Get Your Tracking Number</title>
</head>
 
<body>
<strong>
Welcome!  <br><br>
 
<form action="orderid.cfm" method="post" name="Form" id="Form">
Please Enter Your Invoice/Order Number: &nbsp;&nbsp;
<input name="Invoice" type="text" id="Invoice" size="12" maxlength="25">
<input name="Submit" type="submit" onClick="YY_checkform('Form','ordernum','#q','0','Please Enter an Order Number');return document.MM_returnValue" value="Get Tracking Number">
</form>
</strong>
<br>
<br>
 
<!--- End of user Input --->
 
<!--- When the form is clicked, this is what gets processed. --->
 
<cfif IsDefined("FORM.orderid")> </cfif>
    <CFQUERY NAME="tracking" DATASOURCE="mdb">
        SELECT *
        FROM mdb
    </CFQUERY>
 
    <table border="0" cellspacing="2" cellpadding="2">
        <tr>
            <td width="150"><strong>Invoice Number</strong></td>
            <td width="150"><strong>Name</strong></td>
            <td width="200"><strong>Order Received</strong></td>
        </tr>
 
        <cfoutput query="tracking">
        <tr>
            <td width="150">#Invoice#</td>
            <td width="150">#Name#</td>
            <td width="200">#OrderReceived#</td>
        </tr>
        </cfoutput>
        <!---       --->
 
<cfif IsDefined("FORM.orderid")></cfif>
    <CFQUERY NAME="tracking" DATASOURCE="mdb">
        SELECT Invoice, Name, OrderReceived
        FROM marbeck
        
    </CFQUERY>
 
    <table border="0" cellspacing="2" cellpadding="2">
        <tr>
            <td width="150"><strong>Invoice Number</strong></td>
            <td width="150"><strong>Name</strong></td>
            <td width="200"><strong>Order Received</strong></td>
        </tr>
 
        <cfif GetRecords.RecordCount>
        <cfoutput query="GetRecords">
        <cfif GetRecords.RecordCount GTE 1>
        <tr>
            <td width="150">#Invoice#</td>
            <td width="150">#Name#</td>
            <td width="200">#OrderReceived#</td>
        </tr>
        <cfelse>
        <tr>
            <td>#orderid#</tD>
            <td colspan="2"> Order Number Not Found. Please Try Again.</td>
        </tr>
        </cfif>
        </cfoutput>
 
<cfelse>
 
    <table border="0" cellspacing="2" cellpadding="2">
        <tr>
            <td><cfoutput>#orderid#</cfoutput></tD>
            <td colspan="2">Order Number Not Found. Please Try Again.</td>
        </tr>
    </table>
</cfif>
 
 
<!---The following outputs the 1st name in the db
<cfquery name="queryname" datasource="mdb">
SELECT *
FROM mdb
</cfquery>
 
<cfoutput>#queryname.name#</cfoutput>--->
 
</body>
</html>
[+][-]07/02/09 10:27 AM, ID: 24765568

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 11:08 AM, ID: 24765996

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 11:09 AM, ID: 24766017

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 11:12 AM, ID: 24766040

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 11:39 AM, ID: 24766295

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 11:41 AM, ID: 24766313

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 11:51 AM, ID: 24766418

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 11:57 AM, ID: 24766481

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 12:02 PM, ID: 24766535

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 12:09 PM, ID: 24766603

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 12:17 PM, ID: 24766748

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 12:27 PM, ID: 24766926

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Cold Fusion Markup Language
Sign Up Now!
Solution Provided By: erikTsomik
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07/02/09 12:41 PM, ID: 24767043

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/02/09 12:58 PM, ID: 24767203

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/02/09 12:59 PM, ID: 24767214

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20080625