Main Menu

VB and Databse Help

Started by OJsDad, August 03, 2015, 05:59:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I know a couple of you do some programming.  I'm playing around with Visual Studio 2013, more specifically VB 2013.  I created an Access DB and added it to my VB project.  I then drag one of the tables over to a form.  All of the code seems to create correctly.  I then run the code, add some data into the datagrid click the save button.  However, nothing ever writes to the DB.

Any ideas. 

Here is the code.

Public Class UtilitiesMenu

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnCloseUtilities.Click
    End Sub

    Private Sub NationsBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles NationsBindingNavigatorSaveItem.Click

    End Sub

    Private Sub UtilitiesMenu_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'OneNationDataSet.Nations' table. You can move, or remove it, as needed.

    End Sub

    Private Sub NationsBindingNavigator_RefreshItems(sender As Object, e As EventArgs) Handles NationsBindingNavigator.RefreshItems

    End Sub

End Class
'Here at NASA we all pee the same color.'  Al Harrison from the movie Hidden Figures.


Throwing some lawn darts up into the air...

Can you write a simple script that appends/edits/deletes records from the db?  If you can't append, is it a permissions r/w/x issue?

Can you manually add a record and then query it from vb?  If not, are you sure that you're connecting to the db?

So my shot in the dark is read/write permissions and/or database connectivity.
Clip your freaking corners!
Blood Bowl on VASSAL - Ask me about it!
"Fat, drunk, and stupid is no way to go through life, son."

-Dean Vernon Wormer


Thanks for the ideas GJK.  I did find the answer late last night.

The database used here is in the project folder and with each run of the app the database is copied fresh to the Bin\Debug folder. This means if you add a record, stop the app and run again only two rows show as we overwrote the database. To prevent this select the database in Solution Explorer, select Copy to output folder and use Copy If newer.
'Here at NASA we all pee the same color.'  Al Harrison from the movie Hidden Figures.