Results 1 to 6 of 6

Thread: ADO & updating

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    15

    Lightbulb

    Hi there!,

    I wonder if anyone could help me! plz.

    I have opened up an ADO recordset using an SQL query.
    However when I try to change the textfields in anyway i get
    the error message

    Run-time error '-2147467259(80004005)': Insufficient base table information for updating or refreshing.

    Now i know this because of the query, but I also tried updateing the database via another adorecordset. And when i go back 2 the original recordset to move it to the next record i get the same error message.

    How do i save 2 the database or make any other changes?.

    the sql query i have used is

    SELECT Suppliers.ContactName, Suppliers.Address,Suppliers.City,Suppliers.PostalCode,Suppliers.Phone,Suppliers.Fax,Suppliers.Compan yName, Product.ProductName ,Product.Price,Product.[Batch Number] FROM Suppliers INNER JOIN Product ON Suppliers.SupplierID = Product.Supplier;

    plz help!

  2. #2
    Junior Member
    Join Date
    Jul 2000
    Location
    Mexico
    Posts
    24

    Smile

    Are you sure you can modify a Joined query? I though that was not possible.
    Chicho

  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    It isn't possible, with one exception. If the DBMS you use supports views (and Access does not), you can update the information in the view ***as long as*** you do it one table at a time.

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    Try using this SQL instead:

    SELECT Suppliers.ContactName, Suppliers.Address,Suppliers.City,Suppliers.PostalCode,Suppliers.Phone,Suppliers.Fax,Suppliers.Compan yName, Product.ProductName ,Product.Price,Product.[Batch Number] FROM Suppliers, Product where Suppliers.SupplierID = Product.Supplier;


  5. #5
    Addicted Member
    Join Date
    Jun 2000
    Posts
    132
    i've had the same problem for a program i was writing (and still creating). Do everything in ADO dont try and mix the code up cos its bloody hard to get it right.

    this is my code for add a new record just modify it for updating.

    (all under a button of course!)

    Dim db As Database
    Dim RecDB As New ADODB.Recordset
    Dim ConnectDB As New ADODB.Connection

    ConnectDB.Open ("Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=DATABASENAME.mdb")

    RecDB.Open "TABLE NAME", ConnectDB, adOpenKeyset, adLockOptimistic

    RecDB.AddNew
    RecDB.Fields("Field 1") = textbox1.Text
    RecDB.Fields("Field 3") = textbox2.Text

    RecDB.Update
    RecDB.Close
    ConnectDB.Close

    end sub

    this code works i use all the time for adding and some where i do have the update code but i cant find it at the moment.
    ADO good.
    DAO bad.
    Reality is an illusion caused by by lack of drugs

    Is this real or am i just having a dream?

  6. #6
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Waheed will just need to do it twice because he has _two_ tables.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width