Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2008

    Unanswered: Updating Two tables

    Hello I have two tables users and Private I want to be able to view, update, delete info from the two tables from one screen

    scenario user logs in to system system stores userID and transfers userID to new table this user id will be used by sql to load only that users details (UserID is PK for users and FK for private) the user will be able to update some of their info. as an admin they will use the same procedure except they will be able to see all members details and add new members using update or delete. I have tried to use a data Sqladaptor to do this but the info will display it will not allow delete update. If I load both tables into separate Sqladaptors they are not in sync anyone have any suggestions



  2. #2
    Join Date
    Feb 2004
    So you want to separate permissions? You're talking about 'from one screen'. I take it there's an application presenting it; why not implement the distinction in the application and use a where-clause?

  3. #3
    Join Date
    Jan 2007
    Provided Answers: 10
    Basically you have to handle the update ot both tables in two separate statements. It's just like trying to update a view.

    You'll have to use 2 sqladatptors to get the desired result
    Home | Blog

  4. #4
    Join Date
    Feb 2008

    Question adding a new row

    thanks for the replys

    so for me to add a new row I will have to run two sperate quries to the DB one for each table I am using a VBform to display/add or amend info I have two seperate calls for updating to bits of info in difrent forms but they are on seperate buttons, I want to be able to add a new user this would need to add info to the user and private table. would this mean I will need to do the same update the first table and then update the second table whith two buttons ?

    I have this for one of the update buttons

     Me.SqlCommandPass.Parameters("@UserID").Value = txtUserID.Text
            SqlCommandPass.Parameters("@Password").Value = txtPassword.Text
            Dim rowschanged As Integer
                rowschanged = Me.SqlCommandPass.ExecuteNonQuery()
                MessageBox.Show("Number of rows altered= " & rowschanged)
            Catch ex As Exception
                MessageBox.Show("Error in update: " & ex.Message)
    I would need the button to show the newly generated userID it is auto genetated

    any ideas



Posting Permissions

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