none
Data not being stored in Access 2007 database + vb.net 2008 does not copy Access Database to correct location during Setup.exe.. RRS feed

  • Question

  • I recently created a database program to store passwords. However, when the program is shutdown, and restarted, the data is gone! So, my question is - how do I store the actual inputted data into the database?

     

    My code for adding a record is as follows...

    Code Snippet

     

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    'Add a row of data

    If Len(txtUserName.Text) > 0 And Len(txtPassword.Text) > 0 _

    And Len(txtHTTP.Text) > 0 Then

    Dim Row1 As DataRow

    Dim Table1 As DataTable

    Table1 = Me.Free_Password_SafeDataSet.FPS

    Row1 = Table1.NewRow()

    Row1("Website") = txtHTTP.Text

    Row1("Username") = txtUserName.Text

    Row1("Password") = txtPassword.Text

    Row1("Notes") = txtNotes.Text

    Me.Free_Password_SafeDataSet.FPS.AddFPSRow(Row1)

    Else

    MsgBox("Please enter Username/Password/Website")

    End If

    End Sub

     

     
    But, albeit a record is added, it is not perminently added to the database between program shutdown and loads.
     
    Also, when I 'publish' my database program from vb.net 2008 - I get an arror message stating the Access 2008 database is not found. However, when I copied the access database to the correct location, the error message disappeared. How do I remedy this behaviour of VB.Net 2008 so it copies it to the correct location?
    Monday, November 3, 2008 6:35 PM

Answers

  • Code Snippet

     

    Me.TableAdapterManager.UpdateAll(Me.Free_Password_SafeDataSet)

     

     

    This is the code I added to the end of the record add sub routine and now data is stored between program exits and start ups.

     

    But, the problem remains with VB.Net installing the database to the incorrect location. Please can someone tell me how to tell VB.Net where to install the database correctly?

    Monday, November 3, 2008 6:40 PM

All replies

  • Code Snippet

     

    Me.TableAdapterManager.UpdateAll(Me.Free_Password_SafeDataSet)

     

     

    This is the code I added to the end of the record add sub routine and now data is stored between program exits and start ups.

     

    But, the problem remains with VB.Net installing the database to the incorrect location. Please can someone tell me how to tell VB.Net where to install the database correctly?

    Monday, November 3, 2008 6:40 PM
  • I've got the same problem,

    I've just added a datagrid (using the drag and drop from the data source), then I start my program added a new record, saved it (using the standard save button), closed my program. If I restart it then it'll still be there, but if I close my project and restart it, the record is gone.

    I think the adjusted-database gets overwritten by the old-database


    (Even when I rebuilded my database and my program from scratch the problem remaines)
    Wednesday, July 29, 2009 5:51 PM
  • there is another thread on this question, I am considering this one closed and wil respond to the new question here:
    http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataset/thread/ef81f408-e8db-416b-9864-5223f2f77845

    Thanks
    Chris Robinson
    Program manager - DataSet
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, July 29, 2009 7:52 PM