Connecting Tech Pros Worldwide Help | Site Map

recordset.update method primarykey

  #1  
Old July 4th, 2009, 01:52 PM
Familiar Sight
 
Join Date: Jul 2007
Location: United Kingdom
Posts: 202
Provided Answers: 1
Hi,

I'm attempting to update a record via the recordset.update method, However, the recordset object is defined and accesses the correct record that I want to update, as I can retrieve field values from the record.

The open string for the recordset that I'm using should allow changes:

Expand|Select|Wrap|Line Numbers
  1. ors.open "Select * from products where productname='"&request("txtname")&"'",ocon1,Adopendynamic,Adlockoptimistic
  2.  
there is no problem to update statement but when i use with primarykey & it's automatic number using the following code then : (

Expand|Select|Wrap|Line Numbers
  1. ors.open "Select * from products where productID='"&request("txtids")&"'",ocon1,Adopendynamic,Adlockoptimistic
  2.  
Microsoft JET Database Engine (0x80040E07)
Syntax error in date in query expression 'productID="89"

Is there some other "object" that needs to be defined to allow changes to the record, or something else that I am missing that causes this update to fail?

thanks 4 u reply ( Fary )
  #2  
Old July 6th, 2009, 09:12 PM
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,686

re: recordset.update method primarykey


primary key should not be in quotes:
productID=89 'correct
productID="89" 'incorrect

Let me know if this helps.

Jared
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update statement problems Fary4u answers 1 July 5th, 2009 07:38 PM
update primarykey Fary4u answers 0 July 5th, 2009 10:15 AM
Reading the code in each module via collections Kganesan answers 2 February 5th, 2007 10:24 PM
Input Data from Text File - Checking for Data Already in DB RBohannon answers 7 November 13th, 2005 02:59 AM