Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database record update error 3

Status
Not open for further replies.

hemal666

Programmer
Dec 10, 2001
25
GB
hi, im trying to updaye a access db using a sql update statement......it just wont work...I get an error saying

Microsoft JET Database Engine error '80040e10'

No value given for one or more required parameters.

/modc1.asp, line 50
which points to
Code:
psql = "UPDATE client SET FirstName='"&FirstName&"', LastName='"&LastName&"', sex ='"&sex&"', Address='"&Address&"', City='"&City&"', Town='"&Town&"', PostalCode='"&PostalCode&"', Region='"&Region&"', HomePhone='"&HomePhone&"', MobilePhone='"&MobilePhone&"', EmailName='"&EmailName&"', ReferedBy='"&ReferedBy&"', Notes='"&Notes&"', SpouseName='"&SpouseName&"', ChildrenNames='"&ChildrenNames&"', DateJoinedday='"&DateJoinedday&"', DateJoinedmon='"&DateJoinedmon&"', DateJoinedyr='"&DateJoinedyr&"', Birthdateday='"&Birthdateday&"', Birthdatemon='"&Birthdatemon&"', Birthdateyr='"&Birthdateyr&"', Ethnicity='"&Ethnicity&"', Disabilitiesflag='"&Disabilitiesflag&"', DisabilitesN='"&DisabilitiesN&"' WHERE ContactID LIKE '"&ContactID&"'"
set recset = server.CreateObject("ADODB.Recordset")
recset.open psql , Conn

im so confused as i am sure that the value are passing through correctly.

plaese help!!!!
 
Two things. First, to find your syntax issue (since that appears to be your problem), I would response.write your psql to the screen and then copy and paste it into your db (Query Analyzer if using SQL Server) to see what is missing. This is a pretty common method to find these kinds of problems.

Second, because you are doing an UPDATE query, you do not need to open a recordset because you are not returning any values. Instead, you should just be able to execute from your connection object. It's just a simpler and easier way to accomplish the same task.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
it should look like this:

Code:
dim sql, con

set con = Server.CreateObject("ADODB.Connection")

con.open "your connection string to the database"

sql = "your sql string here"

con.execute(sql)

-DNG
 
Thanks so much for your input poeple.....its appreciated!

i tried changing the code to look like what "DONETGNAT" suggested and got rid off the unrequired record set.....
no joy....

then ive put the SQL statement into Access (through the query builder)....it tells me that my last Field "DisabilitiesN" which is a memo type var ie text....
is not there and when it askes me to enter a value for this feild it tells me its not updateable.......ive checked that the feild settings are correct in access............
now i am properly confused......

 
got it sorted ......the code was correct....managed to narrow it down to a data type problem with one of the fields. thanks for your time people.
hem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top