Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update to Access DB doesnt seem to do anything

Status
Not open for further replies.

tonyladuk

Programmer
Aug 18, 2006
16
US
Hello Smart people!

I've done my research and self taught myself kinda how to use a database with VS2005 in VB. I've looked through the forums for an answer but cant find anything similar so sorry if this has been answered before. I'm using access (for ease of learning).

Here's my code to write back to my database:

Code:
    Public Sub SetAccountsToDataBase()
            Dim dsDataSet As New FPSdataDataSet.accountsDataTable
            Dim dbaAdapter As New FPSdataDataSetTableAdapters.accountsTableAdapter

            dsDataSet.Clear()

            For Each AccountRow As AccountTypeStructure In colAccounts
                Dim newAccountsRow As FPSdataDataSet.accountsRow = dsDataSet.NewaccountsRow
                newAccountsRow.ID = AccountRow.intID
                newAccountsRow.username = AccountRow.strUserName
                newAccountsRow.password = AccountRow.strPassword
                newAccountsRow.acctype = AccountRow.strType
                dsDataSet.Rows.Add(newAccountsRow)
                newAccountsRow = Nothing
            Next

            dbaAdapter.Update(dsDataSet)
            dsDataSet.AcceptChanges()

            dsDataSet = Nothing
            dbaAdapter = Nothing
        End Sub

I have some code to get from the database and save into an arraylist, the rest of the program is spent playing with the data and this section runs through the arraylist to save back to the database. The only thing is, it doesnt seem to do anything. The database doesnt seem to change atall after this procedure. I have no errors, and i'm sure its something simple that Ive just not got to full grips with yet.

Would really appreciate any help.

Thanks in advance.
 
I would suggest that you post this to the VB.Net forum. This forum was created when VB6 was the main VB around, and is intended for VB6 Database issues.

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top