updating a database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eric Kiernan

    updating a database

    i have a recordset which is populated by an sql query similar "select
    customer.custnu m,customer lname+customer. fname as
    name,loans.loan num,loans.write offdate from customer,loans where
    customer.custnu m=loans.custnum ". notice the lname+fname field. when i
    update writeoffdate with a value, the new value never gets written back to
    the database. if i just query "select * from loans", it does. is a
    recordset populated by a query from multiple tables, or virtual fields (
    lname+fname) not updatable? i have the cursor type set to adopenkeyset, so
    that should be fine.


  • Steve Gerrard

    #2
    Re: updating a database


    "Eric Kiernan" <erickiernan@co x.net> wrote in message
    news:2FcZc.6528 2$4o.59836@fed1 read01...
    | i have a recordset which is populated by an sql query similar "select
    | customer.custnu m,customer lname+customer. fname as
    | name,loans.loan num,loans.write offdate from customer,loans where
    | customer.custnu m=loans.custnum ". notice the lname+fname field. when
    i
    | update writeoffdate with a value, the new value never gets written
    back to
    | the database. if i just query "select * from loans", it does. is a
    | recordset populated by a query from multiple tables, or virtual fields
    (
    | lname+fname) not updatable? i have the cursor type set to
    adopenkeyset, so
    | that should be fine.
    |

    Depends on the database you are using - or should I say the provider, to
    use the ADO terminology.

    What you need (I think) is to define the unique table, to which updates
    will apply. Have a look at this and related entries in MSDN:



    With Jet (Access), SQL Server, etc., you can do something like
    RecSet.Properti es("Unique Table") = "loans"

    In my experience, you also need to refresh this if you requery the
    recordset:
    RecSet.Requery
    RecSet.Properti es("Unique Table") = "loans"


    It may turn out that in your case, only the customer table can be
    specified as the unique table anyway, in which case you are out of luck.



    Comment

    Working...