recordset.update method primarykey

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fary4u
    Contributor
    • Jul 2007
    • 273

    recordset.update method primarykey

    Hi,

    I'm attempting to update a record via the recordset.updat e 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:

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

    Code:
    ors.open "Select * from products where productID='"&request("txtids")&"'",ocon1,Adopendynamic,Adlockoptimistic
    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 )
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

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

    Let me know if this helps.

    Jared

    Comment

    Working...