OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Missing Default Values

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> Missing Default Values
Page: [1]
 
mjmtravel

 

Posts: 327
Joined: 7/30/2006
Status: offline

 
Missing Default Values - 3/17/2009 19:34:17   
I hate to beat a dead horse, but I cannot find what I'm missing here. I've read the above and everything else on the forum with no luck.
I have a 3 page database update form, I have page 1&2 working great but when I submit I get this error.

Database Results Error
Description: Syntax error in UPDATE statement.
Number: -2147217900 (0x80040E14)
Source: Microsoft JET Database Engine

One or more form fields were empty. You should provide default values for all form fields that are used in the query.


I'm using FP 2003 and have the run the spooky diet on all 3 pages and I'm using the old fp_class files.
I have every field in the database set with a default of 0, Required is set to NO and Allow zero length is set to YES on all fields. I also have the fields all set to text. The pages its running on is also on the spooky log in. I already have similiar forms on the same site working great. This was a addition. Here is my update statement, any ideas would be great.

fp_sQry="UPDATE CustomerTrips SET TripTitle = '::TripTitle::', Date = '::Date::', FlightDepart = '::FlightDepart::', FlightReturn = '::FlightReturn::', MyComments = '::MyComments::', AirMiles = '::Airmiles::' WHERE (UserName = '" & session("UserName") & "')"
fp_sDefault="UserName"
fp_sNoRecords="Your Personal Travel Log Has Been Updated"
fp_sDataConn="Database2"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&CustomerID=3&UserID=3&UserName=202&TripTitle=202&Date=202&FlightDepart=202&FlightReturn=202&MyComments=202&AirMiles=202&"
fp_iDisplayCols=6
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
pd_it_guy

 

Posts: 215
Joined: 3/4/2008
Status: offline

 
RE: Missing Default Values - 3/17/2009 20:19:25   
I am assuming all the values are being POSTed over from another page.

Every time I have seen that error it's actually correct- so for starters, do a write-out (response.write of the variable pulled with a request.form) of all the variables BEFORE they get to the SQL statement that does the DB write. If the SQL going into error clobbers the whole page, temporarily comment it out or cut it out and drop it on a blank page. That way, you can submit the form, and you can see very quickly what values are coming over- in case you made typo in a variable or form page.

If all variables are accounted for, if the SQL is laid out as we see it, there is a line continuation issue. Normally lines end in " _ and restart in & " That won't get the missing variable though.

Third possibility- in how you are handling dates. I think what you have takes a string and writes it as a string and you are not doing any comparisons. Dates usually come in bounded by pound signs. But I've done them both ways, and that too would not cause the error.

See if any of this helps

(in reply to mjmtravel)
mjmtravel

 

Posts: 327
Joined: 7/30/2006
Status: offline

 
RE: Missing Default Values - 3/17/2009 20:24:32   
Not sure what you are talking about in that first part. Even if I put everything in all the fields I still get the error also.

(in reply to pd_it_guy)
mjmtravel

 

Posts: 327
Joined: 7/30/2006
Status: offline

 
RE: Missing Default Values - 3/23/2009 17:50:20   
It was staring right at me when I looked at the post I put in. Date!!!!! Duh
Thanks for the help.

(in reply to mjmtravel)
Spooky

 

Posts: 26681
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Missing Default Values - 3/25/2009 22:57:05   
Yep, "date" is a reserved word

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to mjmtravel)
jaybee

 

Posts: 14320
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: Missing Default Values - 3/26/2009 6:00:21   
Here's a tip. When training as a programmer many years ago when "we were taught to do things right" :) never name a field generically, ie. Date. Give it a descriptive name such as BirthDate. Two reasons:

1. You are far less likely to end up accidentally using a reserved word
2. It makes it much clearer what it is when some poor devil ends up taking over your code for whatever reason.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to Spooky)
TexasWebDevelopers

 

Posts: 722
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Missing Default Values - 3/26/2009 9:25:36   
I was taught to go one step further...since no restricted word in any database system begins with the letter "x" then the example field name becomes "xbirthdate", and so on.

_____________________________

:)

Follow us on TWITTER

(in reply to jaybee)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> Missing Default Values
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts