Question : Coldfusion data form entry

I'm currently using coldfusion 8 with Microsoft access 2002 as my database. I created a basic form to capture some data. Everything gets submitted into the database except for the disabilityid. I get no error, just an empty field in the disability column.
My Second issue with this form, every time I open this form a null or a blank entry gets inserted into the database. Any help will be much appreciated. I also pasted Debugging Information underneath.
Thanks,



Debugging Information ColdFusion Server Standard 8,0,1,195765
Template  /CF8intro/CF8intro/mmp/mmp.cfm
Time Stamp  13-Jul-10 02:04 PM
Locale  English (US)
User Agent  Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; CMDTDF)
Remote IP  127.0.0.1
Host Name  localhost




--------------------------------------------------------------------------------
Execution Time

Total Time Avg Time Count Template
47 ms 47 ms 1  C:\ColdFusion8\wwwroot\CF8intro\CF8intro\mmp\mmp.cfm
0 ms   STARTUP, PARSING, COMPILING, LOADING, & SHUTDOWN
47 ms   TOTAL EXECUTION TIME
red = over 250 ms average execution time


--------------------------------------------------------------------------------
SQL Queries

(Datasource=mmp, Time=31ms, Records=1) in C:\ColdFusion8\wwwroot\CF8intro\CF8intro\mmp\mmp.cfm @ 14:04:17.017

Insert into people (employee, firstname, lastname, tdate, gender, dob, telephone, address, address2, city, state, zipecode, services, disability, income, notes)
values (

    2
     
,

   'John'
     
,

   'SMith'
     
,

   '07/13/2010'
     
,

   '1'
     
,

   12/13/2000
     
,

   '74591430756'
     
,

   '13255 Ramon '
     
,
 
   'Apt. 255'
     
,
 
   'Inglewood'
     
  ,
   
   'CA'
     
  ,
 
   '92554'
     
  ,
 
   '1'
     
  ,
 
    NULL
 
,
 
   '3'
     
,
 
   'Friendly test'
     
  )

qdisability (Datasource=mmp, Time=0ms, Records=3) in C:\ColdFusion8\wwwroot\CF8intro\CF8intro\mmp\mmp.cfm @ 14:04:17.017

 
Select disabilityid, disability
from disa
order by disability ASC

qservices (Datasource=mmp, Time=0ms, Records=5) in C:\ColdFusion8\wwwroot\CF8intro\CF8intro\mmp\mmp.cfm @ 14:04:17.017

 
Select serviceid, services
from services
order by services ASC

qstaff (Datasource=mmp, Time=0ms, Records=3) in C:\ColdFusion8\wwwroot\CF8intro\CF8intro\mmp\mmp.cfm @ 14:04:17.017

 
Select staffid, lastname+ ', ' +firstname as staffname
from staff
order by lastname ASC

qincome (Datasource=mmp, Time=0ms, Records=4) in C:\ColdFusion8\wwwroot\CF8intro\CF8intro\mmp\mmp.cfm @ 14:04:17.017

 
Select incomeid, income
from income
order by income ASC



--------------------------------------------------------------------------------
Scope Variables

CGI Variables:
AUTH_PASSWORD=
AUTH_TYPE=
AUTH_USER=
CERT_COOKIE=
CERT_FLAGS=
CERT_ISSUER=
CERT_KEYSIZE=
CERT_SECRETKEYSIZE=
CERT_SERIALNUMBER=
CERT_SERVER_ISSUER=
CERT_SERVER_SUBJECT=
CERT_SUBJECT=
CF_TEMPLATE_PATH=C:\ColdFusion8\wwwroot\CF8intro\CF8intro\mmp\mmp.cfm
CONTENT_LENGTH=264
CONTENT_TYPE=application/x-www-form-urlencoded
CONTEXT_PATH=
GATEWAY_INTERFACE=
HTTPS=
HTTPS_KEYSIZE=
HTTPS_SECRETKEYSIZE=
HTTPS_SERVER_ISSUER=
HTTPS_SERVER_SUBJECT=
HTTP_ACCEPT=image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
HTTP_ACCEPT_ENCODING=gzip, deflate
HTTP_ACCEPT_LANGUAGE=en-us
HTTP_CONNECTION=Keep-Alive
HTTP_COOKIE=CFID=101; CFTOKEN=31054938
HTTP_HOST=localhost:8500
HTTP_REFERER=http://localhost:8500/CF8intro/CF8intro/mmp/mmp.cfm
HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; CMDTDF)
PATH_INFO=
PATH_TRANSLATED=C:\ColdFusion8\wwwroot\CF8intro\CF8intro\mmp\mmp.cfm
QUERY_STRING=
REMOTE_ADDR=127.0.0.1
REMOTE_HOST=localhost
REMOTE_USER=
REQUEST_METHOD=POST
SCRIPT_NAME=/CF8intro/CF8intro/mmp/mmp.cfm
SERVER_NAME=localhost
SERVER_PORT=8500
SERVER_PORT_SECURE=0
SERVER_PROTOCOL=HTTP/1.1
SERVER_SOFTWARE=
WEB_SERVER_API=

Cookie Variables:
CFID=101
CFTOKEN=31054938

Form Fields:
ADDRESS=13255 Ramon
ADDRESS2=Apt. 255
CITY=Inglewood
DISABILITYID=1
DOB=12/13/2000
FIELDNAMES=STAFFID,FIRSTNAME,LASTNAME,TDATE,GENDER,DOB,TELEPHONE,ADDRESS,ADDRESS2,CITY,STATE,ZIPECODE,SERVICEID,DISABILITYID,INCOMEID,NOTES,SUBMITFORM
FIRSTNAME=John
GENDER=1
INCOMEID=3
LASTNAME=SMith
NOTES=Friendly test
SERVICEID=1
STAFFID=2
STATE=CA
SUBMITFORM=Submit
TDATE=07/13/2010
TELEPHONE=74591430756
ZIPECODE=92554

Debug Rendering Time: 31 ms
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:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
<cfquery datasource="mmp">
Insert into people (employee, firstname, lastname, tdate, gender, dob, telephone, address, address2, city, state, zipecode, services, disability, income, notes)
values (
<cfif IsDefined("Form.staffid") AND #Form.staffid# NEQ "">
    #Form.staffid#
      <cfelse>
    NULL
  </cfif>
,
<cfif IsDefined("Form.firstname") AND #Form.firstname# NEQ "">
   '#Form.firstname#'
      <cfelse>
    NULL
  </cfif>
,
<cfif IsDefined("Form.lastname") AND #Form.lastname# NEQ "">
   '#Form.lastname#'
      <cfelse>
    NULL
  </cfif>
,
<cfif IsDefined("Form.tdate") AND #Form.tdate# NEQ "">
   '#Form.tdate#'
      <cfelse>
    NULL
  </cfif>
,
<cfif IsDefined("Form.gender") AND #Form.gender# NEQ "">
   '#Form.gender#'
      <cfelse>
    NULL
  </cfif>
,
<cfif IsDefined("Form.dob") AND #Form.dob# NEQ "">
   #Form.dob#
      <cfelse>
    NULL
  </cfif>
,
<cfif IsDefined("Form.telephone") AND #Form.telephone# NEQ "">
   '#Form.telephone#'
      <cfelse>
    NULL
  </cfif>
,
<cfif IsDefined("Form.address") AND #Form.address# NEQ "">
   '#Form.address#'
      <cfelse>
    NULL
  </cfif>
,
 <cfif IsDefined("Form.address2") AND #Form.address2# NEQ "">
   '#Form.address2#'
      <cfelse>
    NULL
  </cfif>
,
  <cfif IsDefined("Form.city") AND #Form.city# NEQ "">
   '#Form.city#'
      <cfelse>
    NULL
  </cfif>
  ,
   <cfif IsDefined("Form.state") AND #Form.state# NEQ "">
   '#Form.state#'
      <cfelse>
    NULL
  </cfif>
  ,
 <cfif IsDefined("Form.zipecode") AND #Form.zipecode# NEQ "">
   '#Form.zipecode#'
      <cfelse>
    NULL
  </cfif>
  ,
 <cfif IsDefined("Form.serviceid") AND #Form.serviceid# NEQ "">
   '#Form.serviceid#'
      <cfelse>
    NULL
  </cfif>
  ,
  <cfif IsDefined("Form.disability") AND #Form.disability# NEQ "">
   '#Form.disability#'
      <cfelse>
    NULL
  </cfif>
,
 <cfif IsDefined("Form.incomeid") AND #Form.incomeid# NEQ "">
   '#Form.incomeid#'
      <cfelse>
    NULL
  </cfif>
,
 <cfif IsDefined("Form.notes") AND #Form.notes# NEQ "">
   '#Form.notes#'
      <cfelse>
    NULL
  </cfif>
  )
</cfquery>



<cfquery name="qdisability" datasource="mmp"> 
Select disabilityid, disability
from disa
order by disability ASC
</cfquery> 

<cfquery name="qservices" datasource="mmp"> 
Select serviceid, services
from services
order by services ASC
</cfquery> 

<cfquery name="qstaff" datasource="mmp"> 
Select staffid, lastname+ ', ' +firstname as staffname 
from staff
order by lastname ASC
</cfquery> 

<cfquery name="qincome" datasource="mmp"> 
Select incomeid, income
from income
order by income ASC
</cfquery>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<h1 align="center">MMP Entry Page </h1>



<cfform name="insmmp">
  <table width="389" border="0" align="center">
   <tr>
      <td nowrap="nowrap"><div align="left">Staff:</div></td>
      <td>
      <cfselect name="staffid" query="qstaff" value="staffid" display="staffname">	
     </cfselect>
     </td>
    </tr>
    <tr>
      <td width="81" nowrap="nowrap">First Name:</td>
      <td width="292"> <cfinput type="text" name="firstname" maxlength="30" required="yes" message="You must enter consumers first name" >
     </td>
    </tr>
    <tr>
      <td nowrap="nowrap">Last Name:</td>
      <td><cfinput type="text" name="lastname" maxlength="30" required="yes" message="You must enter consumers last name" ></td>
    </tr>
    <tr>
      <td nowrap="nowrap">Date:</td>
      <td><CFINPUT TYPE="datefield" NAME="tdate" SIZE="10" REQUIRED="yes" VALIDATE="date" MESSAGE="Please enter date format mm/dd/yyyy.">
      </td>
    </tr>
    <tr>
      <td nowrap="nowrap">Gender:</td>
      <td>
<input type="radio" name="gender" value="1" checked="checked">Male
<input type="radio" name="gender" value="2">Female

</td>
    </tr>
    <tr>
      <td nowrap="nowrap">Date of Birth:</td>
      <td>
   
<CFINPUT TYPE="text" NAME="dob" SIZE="10" REQUIRED="yes" VALIDATE="date" MESSAGE=		"Please enter date format mm/dd/yyyy"></td>
    </tr>
    <tr>
      <td nowrap="nowrap">Telephone:</td>
      <td><CFINPUT TYPE="text" NAME="telephone" SIZE="15" ></td>
    </tr>
    <tr>
      <td nowrap="nowrap">Address</td>
      <td><cfinput type="text" name="address" maxlength="100" required="yes" message="You must enter consumers address" ></td>
    </tr>
    <tr>
      <td nowrap="nowrap">Address 2</td>
      <td><cfinput type="text" name="address2" > </td>
    </tr>
    <tr>
      <td nowrap="nowrap">City</td>
      <td><cfinput type="text" name="city" maxlength="30" required="yes" message="You must enter consumers city" ></td>
    </tr>
    <tr>
      <td nowrap="nowrap">State</td>
      <td><cfinput type="text" name="state" maxlength="30" required="yes" message="Please enter abreviated state such as CA for California"> </td>
    </tr>
    <tr>
      <td nowrap="nowrap">Zip Code</td>
      <td><cfinput type="text" name="zipecode" maxlength="10" required="yes" message="You must enter consumers zip code"> </td>
    </tr>
    <tr>
      <td nowrap="nowrap"><div align="left">Services:</div></td>
      <td>
      <cfselect name="serviceid" query="qservices" value="serviceid" display="services">		</cfselect>        </td>
    </tr>
    <tr>
      <td nowrap="nowrap"><div align="left">Disability:</div></td>
      <td>
      <cfselect name="disabilityid" query="qdisability" value="disabilityid" display="disability">      </cfselect></td>
    </tr>
    <tr>
      <td nowrap="nowrap">Income:</td>
      <td><cfselect name="incomeid" query="qincome" value="incomeid" display="income">		</cfselect> </td>
    </tr>
    <tr>
      <td nowrap="nowrap">Notes:</td>
      <td><textarea name="notes" id="notes" cols="45" rows="5"></textarea></td>
    </tr> <tr>
    <td>
    </td>
   
  <td>
  <!--- Reset button. --->
<cfinput type="Reset" name="ResetForm" value="Clear Form">
<!--- submit button --->
<cfinput type="Submit" name="SubmitForm" value="Submit">
  </td>
  </tr>
  </table>
  <br />

</cfform>


</body>
</html>

Answer : Coldfusion data form entry

Hi, malcolm29.

That's simple.  Change this line of code

Set OLF = GetObject("", "Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)

to

Set OLF = GetObject("", "Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Folders("Tickets")
Random Solutions  
 
programming4us programming4us