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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic MS Access database with Visual Studio 2005

Status
Not open for further replies.

esu4edp

Technical User
Feb 15, 2000
59
0
0
US
Im trying to help my son with a school project his teacher assigned him so were both new and learning.

The assignment is that he is an employee for a bank and his boss wants him to create an access database for a simple check register so other employees can enter the check information. It has four fields in the table, the database we created in access is as follows:

payee - text field
check number - number field
date - date/time field with a date input mask
amount - currency

we saved this as project.mdb

We started a new application in VS 2005 and on form1 we created a new connection to the project.mdb database and tested the connection through the wizard and it tested fine. We then selected the table and the fields and we can see them in VS2005. We then dragged the four things out onto the form1 but when we go to test the form to make sure you can enter new information into it it is not working. It wont save the test data that we entered into the fields such as check number and date and payee and amount. What coding do we need to add or what steps did we miss.
 
You will need, at the very least 1) Your connection 2) A data adapter to grab the data 3) At least an insert command to add to your table, etc.


Does your son's text book not have samples on how to connect, retrieve, add, delete and modify data???
 
You may need to check the 'project.mdb' properties in the Solution Explorer. You should look at the 'Copy to Output Directory' property and make sure it is not set to 'Copy Always'. Basically, Visual Studio always copies the empty database file over any changes that you make at run time with these settings. Change the property to 'Copy if newer' or 'Do not copy'. If you Google 'Typed Dataset Tutorial' you should be able to locate a few step by step examples.

If you choose to battle wits with the witless be prepared to lose.

[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top